diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-08-06 15:55:33 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-08-06 16:11:42 -0400 |
commit | 28b545d04c41d1595a4f162e00b4fecdb090a750 (patch) | |
tree | 037699c8e56f67321dd1f89d6ae8eef97fc9eca1 /cmd/podman/shared | |
parent | f0a5b7ff9944f3666c9d28e1a20f9688307fe93b (diff) | |
download | podman-28b545d04c41d1595a4f162e00b4fecdb090a750.tar.gz podman-28b545d04c41d1595a4f162e00b4fecdb090a750.tar.bz2 podman-28b545d04c41d1595a4f162e00b4fecdb090a750.zip |
When populating CMD, do not include Entrypoint
Previously, we use CreateConfig's Command to populate container
Command (which is used as CMD for Inspect and Commit).
Unfortunately, CreateConfig's Command is the container's full
command, including a prepend of Entrypoint - so we duplicate
Entrypoint for images that include it.
Maintain a separate UserCommand in CreateConfig that does not
include the entrypoint, and use that instead.
Fixes #3708
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/shared')
-rw-r--r-- | cmd/podman/shared/create.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 4de68e4bc..8e356cbcb 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -588,6 +588,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. workDir = data.Config.WorkingDir } + userCommand := []string{} entrypoint := configureEntrypoint(c, data) // Build the command // If we have an entry point, it goes first @@ -597,9 +598,11 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. if len(inputCommand) > 0 { // User command overrides data CMD command = append(command, inputCommand...) + userCommand = append(userCommand, inputCommand...) } else if data != nil && len(data.Config.Cmd) > 0 && !c.IsSet("entrypoint") { // If not user command, add CMD command = append(command, data.Config.Cmd...) + userCommand = append(userCommand, data.Config.Cmd...) } if data != nil && len(command) == 0 { @@ -680,6 +683,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. Cgroupns: c.String("cgroupns"), CgroupParent: c.String("cgroup-parent"), Command: command, + UserCommand: userCommand, Detach: c.Bool("detach"), Devices: c.StringSlice("device"), DNSOpt: c.StringSlice("dns-opt"), |