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
This commit is contained in:
Daniel J Walsh 2018-05-23 11:33:22 -04:00 committed by Atomic Bot
parent 5f0d4b10e9
commit 05bc77f0cb
1 changed files with 3 additions and 1 deletions

View File

@ -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 {