diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-07-31 17:08:06 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-20 12:16:53 -0400 |
commit | d4c3365454d903077ece3c1a31367f639ee24900 (patch) | |
tree | 6d81363c00becc04d10b5d864c03e26948d1f9f7 /libpod/container.go | |
parent | 66fcafa4d45a26b59ad3662419cd3c778e23c39c (diff) | |
download | podman-d4c3365454d903077ece3c1a31367f639ee24900.tar.gz podman-d4c3365454d903077ece3c1a31367f639ee24900.tar.bz2 podman-d4c3365454d903077ece3c1a31367f639ee24900.zip |
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 <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container.go')
-rw-r--r-- | libpod/container.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go index 9ad938a5c..644647bc9 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -261,6 +261,10 @@ type ContainerConfig struct { Mounts []string `json:"mounts,omitempty"` // NamedVolumes lists the named volumes to mount into the container. NamedVolumes []*ContainerNamedVolume `json:"namedVolumes,omitempty"` + // CreateWorkingDir indicates that Libpod should create the container's + // working directory if it does not exist. Some OCI runtimes do this by + // default, but others do not. + CreateWorkingDir bool `json:"createWorkingDir,omitempty"` // Security Config |