aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container_create.go
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2021-11-12 12:56:57 +0100
committerMatthew Heon <mheon@redhat.com>2021-12-06 14:24:06 -0500
commit4ed07fb67d11a875f10173a2a20e9149157b77ce (patch)
tree00fc71a644f7bcfa79372233d982ffcc79f53f82 /pkg/specgen/generate/container_create.go
parent18e9ae59ca0800789ea6cfef3a27516801a7e1a5 (diff)
downloadpodman-4ed07fb67d11a875f10173a2a20e9149157b77ce.tar.gz
podman-4ed07fb67d11a875f10173a2a20e9149157b77ce.tar.bz2
podman-4ed07fb67d11a875f10173a2a20e9149157b77ce.zip
Always create working directory when using compat API
Docker/Moby always create the working directory, and some tools rely on that behavior (example, woodpecker/drone). Fixes #11842 Signed-off-by: Michael Scherer <misc@redhat.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r--pkg/specgen/generate/container_create.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index f82b2a3c6..fc66145df 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -333,6 +333,9 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
if s.WorkDir == "" {
s.WorkDir = "/"
}
+ if s.CreateWorkingDir {
+ options = append(options, libpod.WithCreateWorkingDir())
+ }
if s.StopSignal != nil {
options = append(options, libpod.WithStopSignal(*s.StopSignal))
}