aboutsummaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-05 14:48:28 +0200
committerGitHub <noreply@github.com>2020-08-05 14:48:28 +0200
commitd1aaf3362204f860267e2bb58ec419b25edc5800 (patch)
tree9bad0c5881a7a64635543dec8d037afe66121f9e /libpod/options.go
parent7a7c8e9911c17e4e1748bbf81ab4df27c78426ab (diff)
parent21421c841159f861dfdfed14d9e0f226a5884cf0 (diff)
downloadpodman-d1aaf3362204f860267e2bb58ec419b25edc5800.tar.gz
podman-d1aaf3362204f860267e2bb58ec419b25edc5800.tar.bz2
podman-d1aaf3362204f860267e2bb58ec419b25edc5800.zip
Merge pull request #7176 from mheon/make_entrypoint
Ensure WORKDIR from images is created
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index b98ef2221..16b05d9b6 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1451,6 +1451,19 @@ func WithCreateCommand(cmd []string) CtrCreateOption {
}
}
+// WithCreateWorkingDir tells Podman to create the container's working directory
+// if it does not exist.
+func WithCreateWorkingDir() CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return define.ErrCtrFinalized
+ }
+
+ ctr.config.CreateWorkingDir = true
+ return nil
+ }
+}
+
// Volume Creation Options
// WithVolumeName sets the name of the volume.