aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-05-24 10:19:32 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-24 17:36:37 +0000
commitb09fca74afd12b25f18ae92cbdce19fc625704b1 (patch)
tree93f437f5ff7eccf9535be67da437aaaa99794eda /libpod
parent915364034f1ddf036d277830d45c54b8eb39f940 (diff)
downloadpodman-b09fca74afd12b25f18ae92cbdce19fc625704b1.tar.gz
podman-b09fca74afd12b25f18ae92cbdce19fc625704b1.tar.bz2
podman-b09fca74afd12b25f18ae92cbdce19fc625704b1.zip
Set Entrypoint from image only if not already set
Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #827 Approved by: rhatdan
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index b33ac78e8..9896d0ed7 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -242,8 +242,10 @@ func (c *Container) setupStorage(ctx context.Context) error {
}
// Set the default Entrypoint and Command
- c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
- if len(c.config.Command) == 0 {
+ if c.config.Entrypoint == nil {
+ c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
+ }
+ if c.config.Command == nil {
c.config.Command = containerInfo.Config.Config.Cmd
}