summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-21 11:23:21 -0400
committerGitHub <noreply@github.com>2020-04-21 11:23:21 -0400
commit1ed849f2d10262274ef497ffa4f210eba7cdc72b (patch)
treee374d2cc5a01b30de352c002c104ab927c178cd5 /pkg
parent87b7223df14305bd877fef6227d0078ee33ca72c (diff)
parent224a5ce51e3209b481bcb61caebeba02edd2cce9 (diff)
downloadpodman-1ed849f2d10262274ef497ffa4f210eba7cdc72b.tar.gz
podman-1ed849f2d10262274ef497ffa4f210eba7cdc72b.tar.bz2
podman-1ed849f2d10262274ef497ffa4f210eba7cdc72b.zip
Merge pull request #5921 from baude/v2imageep
add entrypoint from image where needed
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/container.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index d8d3bf11d..8c02731fd 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -13,6 +13,7 @@ import (
)
func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerator) error {
+ var appendEntryPoint bool
newImage, err := r.ImageRuntime().NewFromLocal(s.Image)
if err != nil {
@@ -100,6 +101,7 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
return err
}
if len(s.Entrypoint) < 1 && len(entrypoint) > 0 {
+ appendEntryPoint = true
s.Entrypoint = entrypoint
}
command, err := newImage.Cmd(ctx)
@@ -107,7 +109,10 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
return err
}
if len(s.Command) < 1 && len(command) > 0 {
- s.Command = command
+ if appendEntryPoint {
+ s.Command = entrypoint
+ }
+ s.Command = append(s.Command, command...)
}
if len(s.Command) < 1 && len(s.Entrypoint) < 1 {
return errors.Errorf("No command provided or as CMD or ENTRYPOINT in this image")