mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix #8048 : make docker images repository:tag
work
Make command like "docker images ubuntu:14.04" work and filter out the image with the given tag. Closes #8048. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
3e596da9ea
commit
4fb88d2e11
5 changed files with 99 additions and 4 deletions
|
@ -18,6 +18,39 @@ func (s *DockerSuite) TestImagesEnsureImageIsListed(c *check.C) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *check.C) {
|
||||
_, err := buildImage("imagewithtag:v1",
|
||||
`FROM scratch
|
||||
MAINTAINER dockerio1`, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
_, err = buildImage("imagewithtag:v2",
|
||||
`FROM scratch
|
||||
MAINTAINER dockerio1`, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
out, _ := dockerCmd(c, "images", "imagewithtag:v1")
|
||||
|
||||
if !strings.Contains(out, "imagewithtag") || !strings.Contains(out, "v1") || strings.Contains(out, "v2") {
|
||||
c.Fatal("images should've listed imagewithtag:v1 and not imagewithtag:v2")
|
||||
}
|
||||
|
||||
out, _ = dockerCmd(c, "images", "imagewithtag")
|
||||
|
||||
if !strings.Contains(out, "imagewithtag") || !strings.Contains(out, "v1") || !strings.Contains(out, "v2") {
|
||||
c.Fatal("images should've listed imagewithtag:v1 and imagewithtag:v2")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *check.C) {
|
||||
out, _ := dockerCmd(c, "images", "busybox:nonexistent")
|
||||
|
||||
if strings.Contains(out, "busybox") {
|
||||
c.Fatal("images should not have listed busybox")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestImagesOrderedByCreationDate(c *check.C) {
|
||||
id1, err := buildImage("order:test_a",
|
||||
`FROM scratch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue