Skip to content

Commit

Permalink
Update documentation of commit command to show image reference is opt…
Browse files Browse the repository at this point in the history
…ional

Following
Commit ba1d130 ("make image reference for commit optional")

Updates usage text used by cobra and markdown document used to generate MAN page.

Fixes: containers#5145

Signed-off-by: Allan Jacquet-Cretides <[email protected]>
  • Loading branch information
Jumanjii committed Feb 15, 2020
1 parent 9e9b157 commit 59c9106
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/podman/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
commitDescription = `Create an image from a container's changes. Optionally tag the image created, set the author with the --author flag, set the commit message with the --message flag, and make changes to the instructions with the --change flag.`

_commitCommand = &cobra.Command{
Use: "commit [flags] CONTAINER IMAGE",
Use: "commit [flags] CONTAINER [IMAGE]",
Short: "Create new image based on the changed container",
Long: commitDescription,
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -26,7 +26,8 @@ var (
},
Example: `podman commit -q --message "committing container to image" reverent_golick image-committed
podman commit -q --author "firstName lastName" reverent_golick image-committed
podman commit -q --pause=false containerID image-committed`,
podman commit -q --pause=false containerID image-committed
podman commit containerID`,
}

// ChangeCmds is the list of valid Changes commands to passed to the Commit call
Expand Down
8 changes: 7 additions & 1 deletion docs/source/markdown/podman-commit.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
podman\-commit - Create new image based on the changed container

## SYNOPSIS
**podman commit** [*options*] *container* *image*
**podman commit** [*options*] *container* [*image*]

**podman container commit** [*options*] *container* [*image*]

Expand All @@ -18,6 +18,7 @@ image. If this is not desired, the `--pause` flag can be set to false. When the
is complete, Podman will print out the ID of the new image.

If *image* does not begin with a registry name component, `localhost` will be added to the name.
If *image* is not provided, the values for the `REPOSITORY` and `TAG` values of the created image will each be set to `<none>`.

## OPTIONS

Expand Down Expand Up @@ -86,6 +87,11 @@ $ podman commit -q --pause=false containerID image-committed
e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8
```

```
$ podman commit containerID
e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8
```

## SEE ALSO
podman(1), podman-run(1), podman-create(1)

Expand Down

0 comments on commit 59c9106

Please sign in to comment.