diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-07-14 13:05:25 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-07-22 14:53:26 -0400 |
commit | 4d7626cc897d821bd8c931d1dde1fa0ab236f4f9 (patch) | |
tree | 721a9aa16790e706b993b59a77c46df9d1480d2e /cmd | |
parent | 84076bf95f485bccfd9e03108fb69a1f72b42918 (diff) | |
download | podman-4d7626cc897d821bd8c931d1dde1fa0ab236f4f9.tar.gz podman-4d7626cc897d821bd8c931d1dde1fa0ab236f4f9.tar.bz2 podman-4d7626cc897d821bd8c931d1dde1fa0ab236f4f9.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.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 3722d45b2..aa8669e7a 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -365,9 +365,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 { @@ -375,17 +376,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...) |