diff options
author | baude <bbaude@redhat.com> | 2018-02-14 15:25:06 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-15 00:48:13 +0000 |
commit | e814936915d28286fa88f1211bc354687a358a7c (patch) | |
tree | ab08bd2f109f9ff9baa2bc7c8e0f65c7f94113af /cmd/podman/create.go | |
parent | be9ed1cfacc19d1ad3c09e10481da445615b8b8e (diff) | |
download | podman-e814936915d28286fa88f1211bc354687a358a7c.tar.gz podman-e814936915d28286fa88f1211bc354687a358a7c.tar.bz2 podman-e814936915d28286fa88f1211bc354687a358a7c.zip |
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 <bbaude@redhat.com>
Closes: #333
Approved by: mheon
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r-- | cmd/podman/create.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 { |