From 05bc77f0cb1819e5c7804410224b7472d6ec4d04 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 23 May 2018 11:33:22 -0400 Subject: 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 Closes: #823 Approved by: umohnani8 --- libpod/container_internal.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpod/container_internal.go') 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 { -- cgit v1.2.3-54-g00ecf