2018-03-20 17:41:19 +08:00
# buildah-commit "1" "March 2017" "buildah"
2017-03-29 03:37:24 +08:00
## NAME
2018-04-26 21:01:15 +08:00
buildah\-commit - Create an image from a working container.
2017-03-29 03:37:24 +08:00
## SYNOPSIS
2018-04-05 05:38:41 +08:00
**buildah** **commit** [*options* [...]] **containerID** **imageName**
2017-03-29 03:37:24 +08:00
## DESCRIPTION
2017-04-14 03:42:04 +08:00
Writes a new image using the specified container's read-write layer and if it
2018-05-02 03:37:13 +08:00
is based on an image, the layers of that image. If *imageName* does not begin
with a registry name component, *localhost* will be added to the name.
2017-03-29 03:37:24 +08:00
2018-04-11 01:07:31 +08:00
## RETURN VALUE
The image ID of the image that was created. On error, 1 is returned and errno is returned.
2017-03-29 03:37:24 +08:00
## OPTIONS
2018-01-31 08:19:30 +08:00
**--authfile** *path*
2018-05-02 03:37:13 +08:00
Path of the authentication file. Default is ${XDG\_RUNTIME\_DIR}/containers/auth.json, which is set using `podman login` .
2018-01-31 08:19:30 +08:00
If the authorization state is not found there, $HOME/.docker/config.json is checked, which is set using `docker login` .
2017-08-25 05:44:32 +08:00
**--cert-dir** *path*
2018-05-02 03:37:13 +08:00
Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
2018-02-07 06:00:01 +08:00
Default certificates directory is _/etc/containers/certs.d_ .
2017-08-25 05:44:32 +08:00
**--creds** *creds*
2018-01-25 06:49:37 +08:00
The [username[:password]] to use to authenticate with the registry if required.
If one or both values are not supplied, a command line prompt will appear and the
value can be entered. The password is entered without echo.
2017-08-25 05:44:32 +08:00
2017-06-02 00:11:14 +08:00
**--disable-compression, -D**
2017-03-29 03:37:24 +08:00
2017-04-14 03:42:04 +08:00
Don't compress filesystem layers when building the image.
2017-05-18 05:02:40 +08:00
**--format**
Control the format for the image manifest and configuration data. Recognized
formats include *oci* (OCI image-spec v1.0, the default) and *docker* (version
2, using schema format 2 for the manifest).
2018-04-25 22:00:46 +08:00
**--iidfile** *ImageIDfile*
Write the image ID to the file.
2017-09-22 17:37:40 +08:00
**--quiet**
When writing the output image, suppress progress output.
2017-07-14 20:57:26 +08:00
**--rm**
Remove the container and its content after committing it to an image.
Default leaves the container and its content in place.
2017-09-22 17:37:40 +08:00
**--signature-policy**
Pathname of a signature policy file to use. It is not recommended that this
option be used, as the default behavior of using the system-wide default policy
(frequently */etc/containers/policy.json* ) is most often preferred.
**--tls-verify** *bool-value*
Require HTTPS and verify certificates when talking to container registries (defaults to true)
2017-03-29 03:37:24 +08:00
## EXAMPLE
2017-04-14 03:42:04 +08:00
2017-08-25 05:44:32 +08:00
This example saves an image based on the container.
2018-04-11 01:07:31 +08:00
`buildah commit containerID newImageName`
2017-08-25 05:44:32 +08:00
This example saves an image named newImageName based on the container.
`buildah commit --rm containerID newImageName`
This example saves an image based on the container disabling compression.
`buildah commit --disable-compression containerID`
2017-04-14 03:42:04 +08:00
2017-08-25 05:44:32 +08:00
This example saves an image named newImageName based on the container disabling compression.
`buildah commit --disable-compression containerID newImageName`
2017-04-14 03:42:04 +08:00
2017-08-25 05:44:32 +08:00
This example commits the container to the image on the local registry while turning off tls verification.
`buildah commit --tls-verify=false containerID docker://localhost:5000/imageId`
2017-04-14 03:42:04 +08:00
2017-08-25 05:44:32 +08:00
This example commits the container to the image on the local registry using credentials and certificates for authentication.
`buildah commit --cert-dir ~/auth --tls-verify=true --creds=username:password containerID docker://localhost:5000/imageId`
2017-03-29 03:37:24 +08:00
2018-01-31 08:19:30 +08:00
This example commits the container to the image on the local registry using credentials from the /tmp/auths/myauths.json file and certificates for authentication.
2018-05-02 03:37:13 +08:00
`buildah commit --authfile /tmp/auths/myauths.json --cert-dir ~/auth --tls-verify=true --creds=username:password containerID docker://localhost:5000/imageName`
2018-01-31 08:19:30 +08:00
2017-03-29 03:37:24 +08:00
## SEE ALSO
buildah(1)