1buildah-config(1) General Commands Manual buildah-config(1)
2
3
4
6 buildah-config - Update image configuration settings.
7
8
10 buildah config [options] container
11
12
14 Updates one or more of the settings kept for a container.
15
16
18 --add-history
19
20
21 Add an entry to the image's history which will note changes to the set‐
22 tings for --cmd, --entrypoint, --env, --healthcheck, --label, --on‐
23 build, --port, --shell, --stop-signal, --user, --volume, and --work‐
24 ingdir. Defaults to false.
25
26
27 Note: You can also override the default value of --add-history by set‐
28 ting the BUILDAH_HISTORY environment variable. export BUILDAH_HIS‐
29 TORY=true
30
31
32 --annotation, -a annotation=annotation
33
34
35 Add an image annotation (e.g. annotation=annotation) to the image mani‐
36 fest of any images which will be built using the specified container.
37 Can be used multiple times. If annotation has a trailing -, then the
38 annotation is removed from the config. If the annotation is set to "-"
39 then all annotations are removed from the config.
40
41
42 --arch architecture
43
44
45 Set the target architecture for any images which will be built using
46 the specified container. By default, if the container was based on an
47 image, that image's target architecture is kept, otherwise the host's
48 architecture is recorded.
49
50
51 --author author
52
53
54 Set contact information for the author for any images which will be
55 built using the specified container.
56
57
58 --cmd command
59
60
61 Set the default command to run for containers based on any images which
62 will be built using the specified container. When used in combination
63 with an entry point, this specifies the default parameters for the en‐
64 try point.
65
66
67 --comment comment
68
69
70 Set the image-level comment for any images which will be built using
71 the specified container.
72
73
74 Note: this setting is not present in the OCIv1 image format, so it is
75 discarded when writing images using OCIv1 formats.
76
77
78 --created-by created
79
80
81 Set the description of how the topmost layer was created for any images
82 which will be created using the specified container.
83
84
85 --domainname domain
86
87
88 Set the domainname to set when running containers based on any images
89 built using the specified container.
90
91
92 Note: this setting is not present in the OCIv1 image format, so it is
93 discarded when writing images using OCIv1 formats.
94
95
96 --entrypoint "command" | '["command", "arg1", ...]'
97
98
99 Set the entry point for containers based on any images which will be
100 built using the specified container. buildah supports two formats for
101 entrypoint. It can be specified as a simple string, or as an array of
102 commands.
103
104
105 Note: When the entrypoint is specified as a string, container runtimes
106 will ignore the cmd value of the container image. However if you use
107 the array form, then the cmd will be appended onto the end of the en‐
108 trypoint cmd and be executed together.
109
110
111 --env, -e env[=value]
112
113
114 Add a value (e.g. env=value) to the environment for containers based on
115 any images which will be built using the specified container. Can be
116 used multiple times. If env is named but neither = nor a value is
117 specified, then the value will be taken from the current process envi‐
118 ronment. If env has a trailing -, then the env is removed from the
119 config. If the env is set to "-" then all environment variables are
120 removed from the config.
121
122
123 --healthcheck command
124
125
126 Specify a command which should be run to check if a container is run‐
127 ning correctly.
128
129
130 Values can be NONE, "CMD ..." (run the specified command directly), or
131 "CMD-SHELL ..." (run the specified command using the system's shell),
132 or the empty value (remove a previously-set value and related set‐
133 tings).
134
135
136 Note: this setting is not present in the OCIv1 image format, so it is
137 discarded when writing images using OCIv1 formats.
138
139
140 --healthcheck-interval interval
141
142
143 Specify how often the command specified using the --healthcheck option
144 should be run.
145
146
147 Note: this setting is not present in the OCIv1 image format, so it is
148 discarded when writing images using OCIv1 formats.
149
150
151 --healthcheck-retries count
152
153
154 Specify how many times the command specified using the --healthcheck
155 option can fail before the container is considered to be unhealthy.
156
157
158 Note: this setting is not present in the OCIv1 image format, so it is
159 discarded when writing images using OCIv1 formats.
160
161
162 --healthcheck-start-period interval
163
164
165 Specify how much time can elapse after a container has started before a
166 failure to run the command specified using the --healthcheck option
167 should be treated as an indication that the container is failing. Dur‐
168 ing this time period, failures will be attributed to the container not
169 yet having fully started, and will not be counted as errors. After the
170 command succeeds, or the time period has elapsed, failures will be
171 counted as errors.
172
173
174 Note: this setting is not present in the OCIv1 image format, so it is
175 discarded when writing images using OCIv1 formats.
176
177
178 --healthcheck-timeout interval
179
180
181 Specify how long to wait after starting the command specified using the
182 --healthcheck option to wait for the command to return its exit status.
183 If the command has not returned within this time, it should be consid‐
184 ered to have failed.
185
186
187 Note: this setting is not present in the OCIv1 image format, so it is
188 discarded when writing images using OCIv1 formats.
189
190
191 --history-comment comment
192
193
194 Sets a comment on the topmost layer in any images which will be created
195 using the specified container.
196
197
198 --hostname host
199
200
201 Set the hostname to set when running containers based on any images
202 built using the specified container.
203
204
205 Note: this setting is not present in the OCIv1 image format, so it is
206 discarded when writing images using OCIv1 formats.
207
208
209 --label, -l label=value
210
211
212 Add an image label (e.g. label=value) to the image configuration of any
213 images which will be built using the specified container. Can be used
214 multiple times. If label has a trailing -, then the label is removed
215 from the config. If the label is set to "-" then all labels are re‐
216 moved from the config.
217
218
219 --onbuild onbuild command
220
221
222 Add an ONBUILD command to the image. ONBUILD commands are automati‐
223 cally run when images are built based on the image you are creating.
224
225
226 Note: this setting is not present in the OCIv1 image format, so it is
227 discarded when writing images using OCIv1 formats.
228
229
230 --os operating system
231
232
233 Set the target operating system for any images which will be built us‐
234 ing the specified container. By default, if the container was based on
235 an image, its OS is kept, otherwise the host's OS's name is recorded.
236
237
238 --os-feature feature
239
240
241 Set the name of a required operating system feature for any images
242 which will be built using the specified container. By default, if the
243 container was based on an image, the base image's required OS feature
244 list is kept, if it specified one. This option is typically only mean‐
245 ingful when the image's OS is Windows.
246
247
248 If feature has a trailing -, then the feature is removed from the set
249 of required features which will be listed in the image. If the feature
250 is set to "-" then the entire features list is removed from the config.
251
252
253 --os-version version
254
255
256 Set the exact required operating system version for any images which
257 will be built using the specified container. By default, if the con‐
258 tainer was based on an image, the base image's required OS version is
259 kept, if it specified one. This option is typically only meaningful
260 when the image's OS is Windows, and is typically set in Windows base
261 images, so using this option is usually unnecessary.
262
263
264 --port, -p port/protocol
265
266
267 Add a port to expose when running containers based on any images which
268 will be built using the specified container. Can be used multiple
269 times. To specify whether the port listens on TCP or UDP, use
270 "port/protocol". The default is TCP if the protocol is not specified.
271 To expose the port on both TCP and UDP, specify the port option multi‐
272 ple times. If port has a trailing - and is already set, then the port
273 is removed from the configuration. If the port is set to - then all ex‐
274 posed ports settings are removed from the configuration.
275
276
277 --shell shell
278
279
280 Set the default shell to run inside of the container image. The shell
281 instruction allows the default shell used for the shell form of com‐
282 mands to be overridden. The default shell for Linux containers is
283 "/bin/sh -c".
284
285
286 Note: this setting is not present in the OCIv1 image format, so it is
287 discarded when writing images using OCIv1 formats.
288
289
290 --stop-signal signal
291
292
293 Set default stop signal for container. This signal will be sent when
294 container is stopped, default is SIGINT.
295
296
297 --unsetlabel label
298
299
300 Unset the image label, causing the label not to be inherited from the
301 base image.
302
303
304 --user, -u user[:group]
305
306
307 Set the default user to be used when running containers based on this
308 image. The user can be specified as a user name or UID, optionally
309 followed by a group name or GID, separated by a colon (':'). If names
310 are used, the container should include entries for those names in its
311 /etc/passwd and /etc/group files.
312
313
314 --variant variant
315
316
317 Set the target architecture variant for any images which will be built
318 using the specified container. By default, if the container was based
319 on an image, that image's target architecture and variant information
320 is kept, otherwise the host's architecture and variant are recorded.
321
322
323 --volume, -v volume
324
325
326 Add a location in the directory tree which should be marked as a volume
327 in any images which will be built using the specified container. Can be
328 used multiple times. If volume has a trailing -, and is already set,
329 then the volume is removed from the config. If the volume is set to
330 "-" then all volumes are removed from the config.
331
332
333 --workingdir directory
334
335
336 Set the initial working directory for containers based on images which
337 will be built using the specified container.
338
339
341 buildah config --author='Jane Austen' --workingdir='/etc/mycontainers'
342 containerID
343
344
345 buildah config --entrypoint /entrypoint.sh containerID
346
347
348 buildah config --entrypoint '[ "/entrypoint.sh", "dev" ]' containerID
349
350
351 buildah config --env foo=bar --env PATH=$PATH containerID
352
353
354 buildah config --env foo- containerID
355
356
357 buildah config --label Name=Mycontainer --label Version=1.0 con‐
358 tainerID
359
360
361 buildah config --label Name- containerID
362
363
364 buildah config --annotation note=myNote containerID
365
366
367 buildah config --annotation note-
368
369
370 buildah config --volume /usr/myvol containerID
371
372
373 buildah config --volume /usr/myvol- containerID
374
375
376 buildah config --port 1234 --port 8080 containerID
377
378
379 buildah config --port 514/tcp --port 514/udp containerID
380
381
382 buildah config --env 1234=5678 containerID
383
384
385 buildah config --env 1234- containerID
386
387
388 buildah config --os-version 10.0.19042.1645 containerID
389
390
391 buildah config --os-feature win32k containerID
392
393
394 buildah config --os-feature win32k- containerID
395
396
398 buildah(1)
399
400
401
402buildah March 2017 buildah-config(1)