Skip to content

Commit

Permalink
docker??
Browse files Browse the repository at this point in the history
  • Loading branch information
manugupt1 committed Dec 31, 2022
1 parent 595a97d commit 829ba87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/nerdctl/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,17 @@ func TestDanglingImagesFilter(t *testing.T) {
base := testutil.NewBase(t)
base.Cmd("images", "prune", "--all").AssertOK()

dockerfile := fmt.Sprintf(`FROM %s`, testutil.CommonImage)
dockerfile := fmt.Sprintf(`FROM %s
CMD ["echo", "nerdctl-build-notag-string"]
`, testutil.CommonImage)
buildCtx, err := createBuildContext(dockerfile)
assert.NilError(t, err)

defer os.RemoveAll(buildCtx)
base.Cmd("build", "-f", buildCtx+"/Dockerfile", buildCtx).AssertOK()

// dangling image test
base.Cmd("images").AssertOutContains("<none>")
// base.Cmd("images").AssertOutContains("<none>")
base.Cmd("images", "--filter", "dangling=true").AssertOutContains("<none>")
base.Cmd("images", "--filter", "dangling=false").AssertOutNotContains("<none>")
}

0 comments on commit 829ba87

Please sign in to comment.