diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-14 21:53:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 21:53:47 +0200 |
commit | 50cd21e1811f4fe508a74dc316c81a047de4e8d9 (patch) | |
tree | 79c87a1f6d0ed244a0a29a3a98e5b326d10cd3f4 /cmd/podman | |
parent | c078e936bf5793433359c43498a89943ded3f8fc (diff) | |
parent | 6535c8b9e82a1cc1f5c8d03215b9de5851b2010c (diff) | |
download | podman-50cd21e1811f4fe508a74dc316c81a047de4e8d9.tar.gz podman-50cd21e1811f4fe508a74dc316c81a047de4e8d9.tar.bz2 podman-50cd21e1811f4fe508a74dc316c81a047de4e8d9.zip |
Merge pull request #6939 from rhatdan/entrypoint
Fix handling of entrypoint
Diffstat (limited to 'cmd/podman')
-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 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...) |