1buildah-commit(1)           General Commands Manual          buildah-commit(1)
2
3
4

NAME

6       buildah-commit - Create an image from a working container.
7
8

SYNOPSIS

10       buildah commit [options] container image
11
12

DESCRIPTION

14       Writes a new image using the specified container's read-write layer and
15       if it is based on an image, the layers of that image.   If  image  does
16       not  begin  with  a registry name component, localhost will be added to
17       the name.
18
19

RETURN VALUE

21       The image ID of the image that was created.  On error,  1  is  returned
22       and errno is returned.
23
24

OPTIONS

26       --authfile path
27
28
29       Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/contain‐
30       ers/auth.json, which is set using buildah login.  If the  authorization
31       state  is  not found there, $HOME/.docker/config.json is checked, which
32       is set using docker login.
33
34
35       --cert-dir path
36
37
38       Use certificates at path (*.crt, *.cert, *.key) to connect to the  reg‐
39       istry.  Default certificates directory is /etc/containers/certs.d.
40
41
42       --creds creds
43
44
45       The  [username[:password]]  to use to authenticate with the registry if
46       required.  If one or both values  are  not  supplied,  a  command  line
47       prompt  will  appear  and  the  value  can be entered.  The password is
48       entered without echo.
49
50
51       --disable-compression, -D
52
53
54       Don't compress filesystem layers when building the image unless  it  is
55       required by the location where the image is being written.  This is the
56       default setting, because image layers are compressed automatically when
57       they  are pushed to registries, and images being written to local stor‐
58       age would only need to be decompressed again to be stored.  Compression
59       can be forced in all cases by specifying --disable-compression=false.
60
61
62       --format
63
64
65       Control the format for the image manifest and configuration data.  Rec‐
66       ognized formats include oci (OCI  image-spec  v1.0,  the  default)  and
67       docker (version 2, using schema format 2 for the manifest).
68
69
70       Note:  You  can  also  override the default format by setting the BUIL‐
71       DAH_FORMAT environment variable.  export BUILDAH\_FORMAT=docker
72
73
74       --iidfile ImageIDfile
75
76
77       Write the image ID to the file.
78
79
80       --quiet
81
82
83       When writing the output image, suppress progress output.
84
85
86       --rm Remove the container and its content after  committing  it  to  an
87       image.  Default leaves the container and its content in place.
88
89
90       --squash
91
92
93       Squash  all of the new image's layers (including those inherited from a
94       base image) into a single new layer.
95
96
97       --tls-verify bool-value
98
99
100       Require HTTPS and verify certificates when talking  to  container  reg‐
101       istries (defaults to true)
102
103
104       --omit-timestamp bool-value
105
106
107       Set  the  create timestamp to epoch 0 to allow for deterministic builds
108       (defaults to false).  By default, the created timestamp is changed  and
109       written  into the image manifest with every commit, causing the image's
110       sha256 hash to be different even if the sources are  exactly  the  same
111       otherwise.  When --omit-timestamp is set to true, the created timestamp
112       is always set to the epoch and  therefore  not  changed,  allowing  the
113       image's sha256 to remain the same.
114
115

EXAMPLE

117       This example saves an image based on the container.
118        buildah commit containerID newImageName
119
120
121       This example saves an image named newImageName based on the container.
122        buildah commit --rm containerID newImageName
123
124
125       This  example  saves an image based on the container disabling compres‐
126       sion.
127        buildah commit --disable-compression containerID
128
129
130       This example saves an image named newImageName based on  the  container
131       disabling compression.
132        buildah commit --disable-compression containerID newImageName
133
134
135       This  example  commits the container to the image on the local registry
136       while turning off tls verification.
137        buildah   commit   --tls-verify=false   containerID    docker://local‐
138       host:5000/imageId
139
140
141       This  example  commits the container to the image on the local registry
142       using credentials and certificates for authentication.
143        buildah commit  --cert-dir    /auth   --tls-verify=true  --creds=user‐
144       name:password containerID docker://localhost:5000/imageId
145
146
147       This  example  commits the container to the image on the local registry
148       using credentials from the /tmp/auths/myauths.json  file  and  certifi‐
149       cates for authentication.
150        buildah  commit  --authfile  /tmp/auths/myauths.json --cert-dir  /auth
151       --tls-verify=true --creds=username:password containerID docker://local‐
152       host:5000/imageName
153
154

Files

156       registries.conf (/etc/containers/registries.conf)
157
158
159       registries.conf  is  the  configuration file which specifies which con‐
160       tainer registries should be consulted when completing image names which
161       do not include a registry or domain portion.
162
163
164       policy.json (/etc/containers/policy.json)
165
166
167       Signature  policy  file.   This  defines the trust policy for container
168       images.  Controls which container registries can be used for image, and
169       whether or not the tool should trust the images.
170
171

SEE ALSO

173       buildah(1), policy.json(5), registries.conf(5)
174
175
176
177buildah                           March 2017                 buildah-commit(1)
Impressum