From 333d9af77a65d860b5fd788805cd4c0f2cd232df Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 31 Jul 2020 17:08:06 -0400 Subject: Ensure WORKDIR from images is created A recent crun change stopped the creation of the container's working directory if it does not exist. This is arguably correct for user-specified directories, to protect against typos; it is definitely not correct for image WORKDIR, where the image author definitely intended for the directory to be used. This makes Podman create the working directory and chown it to container root, if it does not already exist, and only if it was specified by an image, not the user. Signed-off-by: Matthew Heon --- test/e2e/run_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 1f9cc3cb0..b666f114b 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -1123,4 +1123,14 @@ USER mail` Expect(session.ExitCode()).To(Not(Equal(0))) Expect(session.ErrorToString()).To(ContainSubstring("Invalid umask")) }) + + It("podman run makes entrypoint from image", func() { + dockerfile := `FROM busybox +WORKDIR /madethis` + podmanTest.BuildImage(dockerfile, "test", "false") + session := podmanTest.Podman([]string{"run", "--rm", "test", "pwd"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring("/madethis")) + }) }) -- cgit v1.2.3-54-g00ecf From 21421c841159f861dfdfed14d9e0f226a5884cf0 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 4 Aug 2020 10:46:10 -0400 Subject: HACK HACK try debugging build Signed-off-by: Matthew Heon --- test/e2e/run_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index b666f114b..f7671603a 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -1125,6 +1125,8 @@ USER mail` }) It("podman run makes entrypoint from image", func() { + // BuildImage does not seem to work remote + SkipIfRemote() dockerfile := `FROM busybox WORKDIR /madethis` podmanTest.BuildImage(dockerfile, "test", "false") -- cgit v1.2.3-54-g00ecf