From 9924956dc88bf91a4d0bf09249ffb4cb960dee01 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 30 Apr 2018 08:26:31 -0500 Subject: do not commit default volumes from container when performing a container commit, we should not add the default list of volumes for a container to the resulting image. it will cause the resulting image to crash when run subsequently. Signed-off-by: baude Closes: #699 Approved by: mheon --- test/e2e/commit_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index 30f208f6f..f95a41896 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -110,4 +110,26 @@ var _ = Describe("Podman commit", func() { check.WaitWithDefaultTimeout() Expect(check.ExitCode()).To(Equal(0)) }) + + It("podman commit with volume mounts", func() { + s := podmanTest.Podman([]string{"run", "--name", "test1", "-v", "/tmp:/foo", "alpine", "date"}) + s.WaitWithDefaultTimeout() + Expect(s.ExitCode()).To(Equal(0)) + + c := podmanTest.Podman([]string{"commit", "test1", "newimage"}) + c.WaitWithDefaultTimeout() + Expect(c.ExitCode()).To(Equal(0)) + + inspect := podmanTest.Podman([]string{"inspect", "newimage"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(Equal(0)) + image := inspect.InspectImageJSON() + _, ok := image[0].ContainerConfig.Volumes["/tmp"] + Expect(ok).To(BeTrue()) + + r := podmanTest.Podman([]string{"run", "newimage"}) + r.WaitWithDefaultTimeout() + Expect(r.ExitCode()).To(Equal(0)) + }) + }) -- cgit v1.2.3-54-g00ecf