aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-10 16:29:48 -0400
committerGitHub <noreply@github.com>2020-08-10 16:29:48 -0400
commit75d2fe63db370d2143bc23519b1026410d6d81f4 (patch)
treef25d7ddee2af14308eba099064d66ee013266427 /cmd
parentf24538b85e9c81be3cb1f4990bd3613986621746 (diff)
parent39c493b3fcc8c1c5203e4511d7ff3250d11de285 (diff)
downloadpodman-75d2fe63db370d2143bc23519b1026410d6d81f4.tar.gz
podman-75d2fe63db370d2143bc23519b1026410d6d81f4.tar.bz2
podman-75d2fe63db370d2143bc23519b1026410d6d81f4.zip
Merge pull request #7256 from mheon/fix_cmd_with_entrypoint
Do not use image CMD if user gave ENTRYPOINT
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/specgen.go18
1 files changed, 1 insertions, 17 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 0b6897d3a..5c6c47e8d 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -387,8 +387,6 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
s.Annotations = annotations
s.WorkDir = c.Workdir
- userCommand := []string{}
- var command []string
if c.Entrypoint != nil {
entrypoint := []string{}
if ep := *c.Entrypoint; len(ep) > 0 {
@@ -398,27 +396,13 @@ 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
}
// Include the command used to create the container.
s.ContainerCreateCommand = os.Args
if len(inputCommand) > 0 {
- // User command overrides data CMD
- command = append(command, inputCommand...)
- userCommand = append(userCommand, inputCommand...)
- }
-
- switch {
- case len(inputCommand) > 0:
- s.Command = userCommand
- case c.Entrypoint != nil:
- s.Command = []string{}
- default:
- s.Command = command
+ s.Command = inputCommand
}
// SHM Size