mirror of https://github.com/containers/podman.git
Merge pull request #9404 from rhatdan/entrypoint
Ignore entrypoint=[""]
This commit is contained in:
commit
2e522ff29c
|
@ -105,7 +105,10 @@ func makeCommand(ctx context.Context, s *specgen.SpecGenerator, img *image.Image
|
||||||
entrypoint = newEntry
|
entrypoint = newEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't append the entrypoint if it is [""]
|
||||||
|
if len(entrypoint) != 1 || entrypoint[0] != "" {
|
||||||
finalCommand = append(finalCommand, entrypoint...)
|
finalCommand = append(finalCommand, entrypoint...)
|
||||||
|
}
|
||||||
|
|
||||||
// Only use image command if the user did not manually set an
|
// Only use image command if the user did not manually set an
|
||||||
// entrypoint.
|
// entrypoint.
|
||||||
|
|
|
@ -43,6 +43,18 @@ CMD []
|
||||||
Expect(session.ExitCode()).To(Equal(125))
|
Expect(session.ExitCode()).To(Equal(125))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman run entrypoint == [\"\"]", func() {
|
||||||
|
dockerfile := `FROM quay.io/libpod/alpine:latest
|
||||||
|
ENTRYPOINT [""]
|
||||||
|
CMD []
|
||||||
|
`
|
||||||
|
podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false")
|
||||||
|
session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest", "echo", "hello"})
|
||||||
|
session.WaitWithDefaultTimeout()
|
||||||
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
Expect(session.OutputToString()).To(Equal("hello"))
|
||||||
|
})
|
||||||
|
|
||||||
It("podman run entrypoint", func() {
|
It("podman run entrypoint", func() {
|
||||||
dockerfile := `FROM quay.io/libpod/alpine:latest
|
dockerfile := `FROM quay.io/libpod/alpine:latest
|
||||||
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
|
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
|
||||||
|
|
Loading…
Reference in New Issue