github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-commit.1.md (about) 1 % podman-commit(1) 2 3 ## NAME 4 podman\-commit - Create new image based on the changed container 5 6 ## SYNOPSIS 7 **podman commit** [*options*] *container* [*image*] 8 9 **podman container commit** [*options*] *container* [*image*] 10 11 ## DESCRIPTION 12 **podman commit** creates an image based on a changed container. The author of the 13 image can be set using the `--author` flag. Various image instructions can be 14 configured with the `--change` flag and a commit message can be set using the 15 `--message` flag. The container and its processes are paused while the image is 16 committed. This minimizes the likelihood of data corruption when creating the new 17 image. If this is not desired, the `--pause` flag can be set to false. When the commit 18 is complete, Podman will print out the ID of the new image. 19 20 If *image* does not begin with a registry name component, `localhost` will be added to the name. 21 If *image* is not provided, the values for the `REPOSITORY` and `TAG` values of the created image will each be set to `<none>`. 22 23 ## OPTIONS 24 25 #### **--author**, **-a**=*author* 26 27 Set the author for the committed image 28 29 #### **--change**, **-c**=*instruction* 30 31 Apply the following possible instructions to the created image: 32 **CMD** | **ENTRYPOINT** | **ENV** | **EXPOSE** | **LABEL** | **ONBUILD** | **STOPSIGNAL** | **USER** | **VOLUME** | **WORKDIR** 33 34 Can be set multiple times 35 36 #### **--format**, **-f**=*format* 37 38 Set the format of the image manifest and metadata. The currently supported formats are _oci_ and _docker_. If 39 not specifically set, the default format used is _oci_. 40 41 #### **--iidfile**=*ImageIDfile* 42 43 Write the image ID to the file. 44 45 #### **--include-volumes** 46 47 Include in the committed image any volumes added to the container by the `--volume` or `--mount` options to the `podman create` and `podman run` commands. 48 49 #### **--message**, **-m**=*message* 50 51 Set commit message for committed image. The message field is not supported in _oci_ format. 52 53 #### **--pause**, **-p** 54 55 Pause the container when creating an image 56 57 #### **--quiet**, **-q** 58 59 Suppress output 60 61 ## EXAMPLES 62 63 ### Create image from container with entrypoint and label 64 ``` 65 $ podman commit --change CMD=/bin/bash --change ENTRYPOINT=/bin/sh --change "LABEL blue=image" reverent_golick image-committed 66 Getting image source signatures 67 Copying blob sha256:b41deda5a2feb1f03a5c1bb38c598cbc12c9ccd675f438edc6acd815f7585b86 68 25.80 MB / 25.80 MB [======================================================] 0s 69 Copying config sha256:c16a6d30f3782288ec4e7521c754acc29d37155629cb39149756f486dae2d4cd 70 448 B / 448 B [============================================================] 0s 71 Writing manifest to image destination 72 Storing signatures 73 e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8 74 ``` 75 76 ### Create image from container with commit message 77 ``` 78 $ podman commit -q --message "committing container to image" 79 reverent_golick image-committed 80 e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8 ``` 81 ``` 82 83 ### Create image from container with author 84 ``` 85 $ podman commit -q --author "firstName lastName" reverent_golick image-committed 86 e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8 87 ``` 88 89 ### Pause a running container while creating the image 90 ``` 91 $ podman commit -q --pause=true containerID image-committed 92 e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8 93 ``` 94 95 ### Create an image from a container with a default image tag 96 ``` 97 $ podman commit containerID 98 e3ce4d93051ceea088d1c242624d659be32cf1667ef62f1d16d6b60193e2c7a8 99 ``` 100 101 ### Create an image from container with default required capabilities are SETUID and SETGID 102 ``` 103 $ podman commit -q --change LABEL=io.containers.capabilities=setuid,setgid epic_nobel privimage 104 400d31a3f36dca751435e80a0e16da4859beb51ff84670ce6bdc5edb30b94066 105 ``` 106 107 ## SEE ALSO 108 podman(1), podman-run(1), podman-create(1) 109 110 ## HISTORY 111 December 2017, Originally compiled by Urvashi Mohnani <umohnani@redhat.com>