summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-15 14:04:08 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-15 18:24:37 +0000
commit4bc166446d61f9fde69c91e73b6043b8ba9040fc (patch)
tree3cf106005bcdd116a951111d24ff33fe12755dd9
parent99b959560aee809cbd72f71947e934ee76b23ef3 (diff)
downloadpodman-4bc166446d61f9fde69c91e73b6043b8ba9040fc.tar.gz
podman-4bc166446d61f9fde69c91e73b6043b8ba9040fc.tar.bz2
podman-4bc166446d61f9fde69c91e73b6043b8ba9040fc.zip
We should not have a default workdir
Having a default workdir is causing us not to use the container images workdir. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #501 Approved by: mheon
-rw-r--r--cmd/podman/common.go1
-rw-r--r--cmd/podman/create.go6
2 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index 8dee6cb98..60cc48803 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -390,6 +390,5 @@ var createFlags = []cli.Flag{
cli.StringFlag{
Name: "workdir, w",
Usage: "Working `directory inside the container",
- Value: "/",
},
}
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index b923ad458..462c56a51 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -566,8 +566,10 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string,
}
// WORKING DIRECTORY
- workDir := c.String("workdir")
- if workDir == "" {
+ workDir := "/"
+ if c.IsSet("workdir") {
+ workDir = c.String("workdir")
+ } else if data.ContainerConfig.WorkingDir != "" {
workDir = data.ContainerConfig.WorkingDir
}