summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/commit.go9
-rw-r--r--docs/source/markdown/podman-commit.1.md2
2 files changed, 7 insertions, 4 deletions
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go
index e98b71514..604e8d31c 100644
--- a/cmd/podman/commit.go
+++ b/cmd/podman/commit.go
@@ -56,12 +56,15 @@ func commitCmd(c *cliconfig.CommitValues) error {
defer runtime.DeferredShutdown(false)
args := c.InputArgs
- if len(args) != 2 {
- return errors.Errorf("you must provide a container name or ID and a target image name")
+ if len(args) < 1 {
+ return errors.Errorf("you must provide a container name or ID and optionally a target image name")
}
container := args[0]
- reference := args[1]
+ reference := ""
+ if len(args) > 1 {
+ reference = args[1]
+ }
if c.Flag("change").Changed {
for _, change := range c.Change {
splitChange := strings.Split(strings.ToUpper(change), "=")
diff --git a/docs/source/markdown/podman-commit.1.md b/docs/source/markdown/podman-commit.1.md
index 07a885ae2..042ec7934 100644
--- a/docs/source/markdown/podman-commit.1.md
+++ b/docs/source/markdown/podman-commit.1.md
@@ -6,7 +6,7 @@ podman\-commit - Create new image based on the changed container
## SYNOPSIS
**podman commit** [*options*] *container* *image*
-**podman container commit** [*options*] *container* *image*
+**podman container commit** [*options*] *container* [*image*]
## DESCRIPTION
**podman commit** creates an image based on a changed container. The author of the