From e814936915d28286fa88f1211bc354687a358a7c Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 14 Feb 2018 15:25:06 -0600 Subject: No entrpoint, cmd, or command When an image does not have an ENTRYPOINT nor a CMD and the user does not provide a command in the CLI, we should fail gracefully. This resolves issue #328 Signed-off-by: baude Closes: #333 Approved by: mheon --- cmd/podman/create.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/create.go b/cmd/podman/create.go index 2012aa6de..5e2ea3969 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -587,6 +587,10 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string, command = append(command, data.ContainerConfig.Cmd...) } + if len(command) == 0 { + return nil, errors.Errorf("No command specified on command line or as CMD or ENTRYPOINT in this image") + } + // EXPOSED PORTS portBindings, err := exposedPorts(c, data.ContainerConfig.ExposedPorts) if err != nil { -- cgit v1.2.3-54-g00ecf