aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-05-23 11:33:22 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-23 18:39:06 +0000
commit05bc77f0cb1819e5c7804410224b7472d6ec4d04 (patch)
tree67f6c4dcb107376a1560f8cdff890a396a2d6291 /libpod
parent5f0d4b10e9b5ea18e91090e82ddfb22f63b06635 (diff)
downloadpodman-05bc77f0cb1819e5c7804410224b7472d6ec4d04.tar.gz
podman-05bc77f0cb1819e5c7804410224b7472d6ec4d04.tar.bz2
podman-05bc77f0cb1819e5c7804410224b7472d6ec4d04.zip
Fix handling of command in images
Currently we are dropping the command entry from the create line and using the image Cmd. This change will only use the image Cmd if the user did not specify a Cmd. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #823 Approved by: umohnani8
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index e34a79eb1..b33ac78e8 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -243,7 +243,9 @@ func (c *Container) setupStorage(ctx context.Context) error {
// Set the default Entrypoint and Command
c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
- c.config.Command = containerInfo.Config.Config.Cmd
+ if len(c.config.Command) == 0 {
+ c.config.Command = containerInfo.Config.Config.Cmd
+ }
artifacts := filepath.Join(c.config.StaticDir, artifactsDir)
if err := os.MkdirAll(artifacts, 0755); err != nil {