summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-07-14 13:05:25 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-07-14 13:10:03 -0400
commit6535c8b9e82a1cc1f5c8d03215b9de5851b2010c (patch)
treed99a0008d253b9bbb61f899eae6ca0143171a9af /cmd
parentd83077b16c14b05967fa1f92c7067299367a286f (diff)
downloadpodman-6535c8b9e82a1cc1f5c8d03215b9de5851b2010c.tar.gz
podman-6535c8b9e82a1cc1f5c8d03215b9de5851b2010c.tar.bz2
podman-6535c8b9e82a1cc1f5c8d03215b9de5851b2010c.zip
Fix handling of entrypoint
If a user specifies an entrypoint of "" then we should not use the images entrypoint. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/specgen.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index f17077484..8a265cedf 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -367,9 +367,10 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
s.Annotations = annotations
s.WorkDir = c.Workdir
- entrypoint := []string{}
userCommand := []string{}
+ var command []string
if c.Entrypoint != nil {
+ entrypoint := []string{}
if ep := *c.Entrypoint; len(ep) > 0 {
// Check if entrypoint specified is json
if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil {
@@ -377,17 +378,14 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
}
}
s.Entrypoint = entrypoint
+ // Build the command
+ // If we have an entry point, it goes first
+ command = entrypoint
}
- var command []string
// Include the command used to create the container.
s.ContainerCreateCommand = os.Args
- // Build the command
- // If we have an entry point, it goes first
- if c.Entrypoint != nil {
- command = entrypoint
- }
if len(inputCommand) > 0 {
// User command overrides data CMD
command = append(command, inputCommand...)