1buildah-from(1) General Commands Manual buildah-from(1)
2
3
4
6 buildah-from - Creates a new working container, either from scratch or
7 using a specified image as a starting point.
8
9
11 buildah from [options] image
12
13
15 Creates a working container based upon the specified image name. If
16 the supplied image name is "scratch" a new empty container is created.
17 Image names use a "transport":"details" format.
18
19
20 Multiple transports are supported:
21
22
23 dir:path
24 An existing local directory path containing the manifest, layer tar‐
25 balls, and signatures in individual files. This is a non-standardized
26 format, primarily useful for debugging or noninvasive image inspection.
27
28
29 docker://docker-reference (Default)
30 An image in a registry implementing the "Docker Registry HTTP API
31 V2". By default, uses the authorization state in $XDG\_RUN‐
32 TIME\_DIR/containers/auth.json, which is set using (buildah login). If
33 XDG_RUNTIME_DIR is not set, the default is /run/contain‐
34 ers/$UID/auth.json. If the authorization state is not found there,
35 $HOME/.docker/config.json is checked, which is set using (docker lo‐
36 gin).
37 If docker-reference does not include a registry name, localhost will
38 be consulted first, followed by any registries named in the registries
39 configuration.
40
41
42 docker-archive:path
43 An image is retrieved as a podman load formatted file.
44
45
46 docker-daemon:docker-reference
47 An image docker-reference stored in the docker daemon's internal
48 storage. docker-reference must include either a tag or a digest. Al‐
49 ternatively, when reading images, the format can also be docker-dae‐
50 mon:algo:digest (an image ID).
51
52
53 oci:path:tag**
54 An image tag in a directory compliant with "Open Container Image Lay‐
55 out Specification" at path.
56
57
58 oci-archive:path:tag
59 An image tag in a directory compliant with "Open Container Image Lay‐
60 out Specification" at path.
61
62
63 DEPENDENCIES
64 Buildah resolves the path to the registry to pull from by using the
65 /etc/containers/registries.conf file, containers-registries.conf(5).
66 If the buildah from command fails with an "image not known" error,
67 first verify that the registries.conf file is installed and configured
68 appropriately.
69
70
72 The container ID of the container that was created. On error 1 is re‐
73 turned.
74
75
77 --add-host=[]
78
79
80 Add a custom host-to-IP mapping (host:ip)
81
82
83 Add a line to /etc/hosts. The format is hostname:ip. The --add-host op‐
84 tion can be set multiple times.
85
86
87 --arch="ARCH"
88
89
90 Set the ARCH of the image to be pulled to the provided value instead of
91 using the architecture of the host. (Examples: arm, arm64, 386, amd64,
92 ppc64le, s390x)
93
94
95 --authfile path
96
97
98 Path of the authentication file. Default is ${XDG_\RUNTIME_DIR}/con‐
99 tainers/auth.json. If XDG_RUNTIME_DIR is not set, the default is
100 /run/containers/$UID/auth.json. This file is created using buildah lo‐
101 gin.
102
103
104 If the authorization state is not found there, $HOME/.docker/con‐
105 fig.json is checked, which is set using docker login.
106
107
108 Note: You can also override the default path of the authentication file
109 by setting the REGISTRY_AUTH_FILE environment variable. export REG‐
110 ISTRY_AUTH_FILE=path
111
112
113 --cap-add=CAP_xxx
114
115
116 Add the specified capability to the default set of capabilities which
117 will be supplied for subsequent buildah run invocations which use this
118 container. Certain capabilities are granted by default; this option
119 can be used to add more.
120
121
122 --cap-drop=CAP_xxx
123
124
125 Remove the specified capability from the default set of capabilities
126 which will be supplied for subsequent buildah run invocations which use
127 this container. The CAP_AUDIT_WRITE, CAP_CHOWN, CAP_DAC_OVERRIDE,
128 CAP_FOWNER, CAP_FSETID, CAP_KILL, CAP_MKNOD, CAP_NET_BIND_SERVICE,
129 CAP_SETFCAP, CAP_SETGID, CAP_SETPCAP, CAP_SETUID, and CAP_SYS_CHROOT
130 capabilities are granted by default; this option can be used to remove
131 them.
132
133
134 If a capability is specified to both the --cap-add and --cap-drop op‐
135 tions, it will be dropped, regardless of the order in which the options
136 were given.
137
138
139 --cert-dir path
140
141
142 Use certificates at path (*.crt, *.cert, *.key) to connect to the reg‐
143 istry. The default certificates directory is /etc/containers/certs.d.
144
145
146 --cgroup-parent=""
147
148
149 Path to cgroups under which the cgroup for the container will be cre‐
150 ated. If the path is not absolute, the path is considered to be rela‐
151 tive to the cgroups path of the init process. Cgroups will be created
152 if they do not already exist.
153
154
155 --cgroupns how
156
157
158 Sets the configuration for IPC namespaces when the container is subse‐
159 quently used for buildah run. The configured value can be "" (the
160 empty string) or "private" to indicate that a new cgroup namespace
161 should be created, or it can be "host" to indicate that the cgroup
162 namespace in which buildah itself is being run should be reused.
163
164
165 --cidfile ContainerIDFile
166
167
168 Write the container ID to the file.
169
170
171 --cpu-period=0
172
173
174 Limit the CPU CFS (Completely Fair Scheduler) period
175
176
177 Limit the container's CPU usage. This flag tells the kernel to restrict
178 the container's CPU usage to the period you specify.
179
180
181 --cpu-quota=0
182
183
184 Limit the CPU CFS (Completely Fair Scheduler) quota
185
186
187 Limit the container's CPU usage. By default, containers run with the
188 full CPU resource. This flag tells the kernel to restrict the con‐
189 tainer's CPU usage to the quota you specify.
190
191
192 --cpu-shares, -c=0
193
194
195 CPU shares (relative weight)
196
197
198 By default, all containers get the same proportion of CPU cycles. This
199 proportion can be modified by changing the container's CPU share
200 weighting relative to the weighting of all other running containers.
201
202
203 To modify the proportion from the default of 1024, use the --cpu-shares
204 flag to set the weighting to 2 or higher.
205
206
207 The proportion will only apply when CPU-intensive processes are run‐
208 ning. When tasks in one container are idle, other containers can use
209 the left-over CPU time. The actual amount of CPU time will vary depend‐
210 ing on the number of containers running on the system.
211
212
213 For example, consider three containers, one has a cpu-share of 1024 and
214 two others have a cpu-share setting of 512. When processes in all three
215 containers attempt to use 100% of CPU, the first container would re‐
216 ceive 50% of the total CPU time. If you add a fourth container with a
217 cpu-share of 1024, the first container only gets 33% of the CPU. The
218 remaining containers receive 16.5%, 16.5% and 33% of the CPU.
219
220
221 On a multi-core system, the shares of CPU time are distributed over all
222 CPU cores. Even if a container is limited to less than 100% of CPU
223 time, it can use 100% of each individual CPU core.
224
225
226 For example, consider a system with more than three cores. If you start
227 one container {C0} with -c=512 running one process, and another con‐
228 tainer {C1} with -c=1024 running two processes, this can result in the
229 following division of CPU shares:
230
231
232 PID container CPU CPU share
233 100 {C0} 0 100% of CPU0
234 101 {C1} 1 100% of CPU1
235 102 {C1} 2 100% of CPU2
236
237
238
239 --cpuset-cpus=""
240
241
242 CPUs in which to allow execution (0-3, 0,1)
243
244
245 --cpuset-mems=""
246
247
248 Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effec‐
249 tive on NUMA systems.
250
251
252 If you have four memory nodes on your system (0-3), use --cpuset-
253 mems=0,1 then processes in your container will only use memory from the
254 first two memory nodes.
255
256
257 --creds creds
258
259
260 The [username[:password]] to use to authenticate with the registry if
261 required. If one or both values are not supplied, a command line
262 prompt will appear and the value can be entered. The password is en‐
263 tered without echo.
264
265
266 --decryption-key key[:passphrase]
267
268
269 The [key[:passphrase]] to be used for decryption of images. Key can
270 point to keys and/or certificates. Decryption will be tried with all
271 keys. If the key is protected by a passphrase, it is required to be
272 passed in the argument and omitted otherwise.
273
274
275 --device=device
276
277
278 Add a host device or devices under a directory to the container. The
279 format is <device-on-host>[:<device-on-container>][:<permissions>]
280 (e.g. --device=/dev/sdc:/dev/xvdc:rwm)
281
282
283 --dns=[]
284
285
286 Set custom DNS servers
287
288
289 This option can be used to override the DNS configuration passed to the
290 container. Typically this is necessary when the host DNS configuration
291 is invalid for the container (e.g., 127.0.0.1). When this is the case
292 the --dns flag is necessary for every run.
293
294
295 The special value none can be specified to disable creation of /etc/re‐
296 solv.conf in the container by Buildah. The /etc/resolv.conf file in the
297 image will be used without changes.
298
299
300 --dns-option=[]
301
302
303 Set custom DNS options
304
305
306 --dns-search=[]
307
308
309 Set custom DNS search domains
310
311
312 --format, -f oci | docker
313
314
315 Control the format for the built image's manifest and configuration
316 data. Recognized formats include oci (OCI image-spec v1.0, the de‐
317 fault) and docker (version 2, using schema format 2 for the manifest).
318
319
320 Note: You can also override the default format by setting the BUIL‐
321 DAH_FORMAT environment variable. export BUILDAH_FORMAT=docker
322
323
324 --http-proxy
325
326
327 By default proxy environment variables are passed into the container if
328 set for the Buildah process. This can be disabled by setting the
329 --http-proxy option to false. The environment variables passed in in‐
330 clude http_proxy, https_proxy, ftp_proxy, no_proxy, and also the upper
331 case versions of those.
332
333
334 Defaults to true
335
336
337 --ipc how
338
339
340 Sets the configuration for IPC namespaces when the container is subse‐
341 quently used for buildah run. The configured value can be "" (the
342 empty string) or "container" to indicate that a new IPC namespace
343 should be created, or it can be "host" to indicate that the IPC name‐
344 space in which Buildah itself is being run should be reused, or it can
345 be the path to an IPC namespace which is already in use by another
346 process.
347
348
349 --isolation type
350
351
352 Controls what type of isolation is used for running processes under
353 buildah run. Recognized types include oci (OCI-compatible runtime, the
354 default), rootless (OCI-compatible runtime invoked using a modified
355 configuration, with --no-new-keyring added to its create invocation,
356 reusing the host's network and UTS namespaces, and creating private
357 IPC, PID, mount, and user namespaces; the default for unprivileged
358 users), and chroot (an internal wrapper that leans more toward ch‐
359 root(1) than container technology, reusing the host's control group,
360 network, IPC, and PID namespaces, and creating private mount and UTS
361 namespaces, and creating user namespaces only when they're required for
362 ID mapping).
363
364
365 Note: You can also override the default isolation type by setting the
366 BUILDAH_ISOLATION environment variable. export BUILDAH_ISOLATION=oci
367
368
369 --memory, -m=""
370
371
372 Memory limit (format: [], where unit = b, k, m or g)
373
374
375 Allows you to constrain the memory available to a container. If the
376 host supports swap memory, then the -m memory setting can be larger
377 than physical RAM. If a limit of 0 is specified (not using -m), the
378 container's memory is not limited. The actual limit may be rounded up
379 to a multiple of the operating system's page size (the value would be
380 very large, that's millions of trillions).
381
382
383 --memory-swap="LIMIT"
384
385
386 A limit value equal to memory plus swap. Must be used with the -m
387 (--memory) flag. The swap LIMIT should always be larger than -m (--mem‐
388 ory) value. By default, the swap LIMIT will be set to double the value
389 of --memory.
390
391
392 The format of LIMIT is <number>[<unit>]. Unit can be b (bytes), k
393 (kilobytes), m (megabytes), or g (gigabytes). If you don't specify a
394 unit, b is used. Set LIMIT to -1 to enable unlimited swap.
395
396
397 --name name
398
399
400 A name for the working container
401
402
403 --network how, --net how
404
405
406 Sets the configuration for network namespaces when the container is
407 subsequently used for buildah run. The configured value can be "" (the
408 empty string) or "container" to indicate that a new network namespace
409 should be created, or it can be "host" to indicate that the network
410 namespace in which Buildah itself is being run should be reused, or it
411 can be the path to a network namespace which is already in use by an‐
412 other process.
413
414
415 --os="OS"
416
417
418 Set the OS of the image to be pulled to the provided value instead of
419 using the current operating system of the host.
420
421
422 --pid how
423
424
425 Sets the configuration for PID namespaces when the container is subse‐
426 quently used for buildah run. The configured value can be "" (the
427 empty string) or "container" to indicate that a new PID namespace
428 should be created, or it can be "host" to indicate that the PID name‐
429 space in which Buildah itself is being run should be reused, or it can
430 be the path to a PID namespace which is already in use by another
431 process.
432
433
434 --platform="OS/ARCH[/VARIANT]"
435
436
437 Set the OS/ARCH of the image to be pulled to the provided value instead
438 of using the current operating system and architecture of the host (for
439 example linux/arm).
440
441
442 OS/ARCH pairs are those used by the Go Programming Language. In sev‐
443 eral cases the ARCH value for a platform differs from one produced by
444 other tools such as the arch command. Valid OS and architecture name
445 combinations are listed as values for $GOOS and $GOARCH at
446 https://golang.org/doc/install/source#environment, and can also be
447 found by running go tool dist list.
448
449
450 While buildah from is happy to pull an image for any platform that ex‐
451 ists, buildah run will not be able to run binaries provided by that im‐
452 age without the help of emulation provided by packages like qemu-user-
453 static.
454
455
456 NOTE: The --platform option may not be used in combination with the
457 --arch, --os, or --variant options.
458
459
460 --pull
461
462
463 When the flag is enabled or set explicitly to true (with --pull=true),
464 attempt to pull the latest image from the registries listed in reg‐
465 istries.conf if a local image does not exist or the image is newer than
466 the one in storage. Raise an error if the image is not in any listed
467 registry and is not present locally.
468
469
470 If the flag is disabled (with --pull=false), do not pull the image from
471 the registry, use only the local version. Raise an error if the image
472 is not present locally.
473
474
475 If the pull flag is set to always (with --pull=always), pull the image
476 from the first registry it is found in as listed in registries.conf.
477 Raise an error if not found in the registries, even if the image is
478 present locally.
479
480
481 If the pull flag is set to never (with --pull=never), Do not pull the
482 image from the registry, use only the local version. Raise an error if
483 the image is not present locally.
484
485
486 Defaults to true.
487
488
489 --quiet, -q
490
491
492 If an image needs to be pulled from the registry, suppress progress
493 output.
494
495
496 --retry attempts
497
498
499 Number of times to retry in case of failure when performing pull of im‐
500 ages from registry.
501
502
503 Defaults to 3.
504
505
506 --retry-delay duration
507
508
509 Duration of delay between retry attempts in case of failure when per‐
510 forming pull of images from registry.
511
512
513 Defaults to 2s.
514
515
516 --security-opt=[]
517
518
519 Security Options
520
521
522 "label=user:USER" : Set the label user for the container
523 "label=role:ROLE" : Set the label role for the container
524 "label=type:TYPE" : Set the label type for the container
525 "label=level:LEVEL" : Set the label level for the container
526 "label=disable" : Turn off label confinement for the container
527 "no-new-privileges" : Not supported
528
529
530 "seccomp=unconfined" : Turn off seccomp confinement for the container
531 "seccomp=profile.json : White listed syscalls seccomp Json file to
532 be used as a seccomp filter
533
534
535 "apparmor=unconfined" : Turn off apparmor confinement for the container
536 "apparmor=your-profile" : Set the apparmor confinement profile for
537 the container
538
539
540 --shm-size=""
541
542
543 Size of /dev/shm. The format is <number><unit>. number must be greater
544 than 0. Unit is optional and can be b (bytes), k (kilobytes),
545 m(megabytes), or g (gigabytes). If you omit the unit, the system uses
546 bytes. If you omit the size entirely, the system uses 64m.
547
548
549 --tls-verify bool-value
550
551
552 Require HTTPS and verification of certificates when talking to con‐
553 tainer registries (defaults to true). TLS verification cannot be used
554 when talking to an insecure registry.
555
556
557 --ulimit type=soft-limit[:hard-limit]
558
559
560 Specifies resource limits to apply to processes launched during buildah
561 run. This option can be specified multiple times. Recognized resource
562 types include:
563 "core": maximum core dump size (ulimit -c)
564 "cpu": maximum CPU time (ulimit -t)
565 "data": maximum size of a process's data segment (ulimit -d)
566 "fsize": maximum size of new files (ulimit -f)
567 "locks": maximum number of file locks (ulimit -x)
568 "memlock": maximum amount of locked memory (ulimit -l)
569 "msgqueue": maximum amount of data in message queues (ulimit -q)
570 "nice": niceness adjustment (nice -n, ulimit -e)
571 "nofile": maximum number of open files (ulimit -n)
572 "nofile": maximum number of open files (1048576); when run by root
573 "nproc": maximum number of processes (ulimit -u)
574 "nproc": maximum number of processes (1048576); when run by root
575 "rss": maximum size of a process's (ulimit -m)
576 "rtprio": maximum real-time scheduling priority (ulimit -r)
577 "rttime": maximum amount of real-time execution between blocking
578 syscalls
579 "sigpending": maximum number of pending signals (ulimit -i)
580 "stack": maximum stack size (ulimit -s)
581
582
583 --userns how
584
585
586 Sets the configuration for user namespaces when the container is subse‐
587 quently used for buildah run. The configured value can be "" (the
588 empty string) or "container" to indicate that a new user namespace
589 should be created, it can be "host" to indicate that the user namespace
590 in which Buildah itself is being run should be reused, or it can be the
591 path to an user namespace which is already in use by another process.
592
593
594 --userns-gid-map-group mapping
595
596
597 Directly specifies a GID mapping which should be used to set ownership,
598 at the filesystem level, on the container's contents. Commands run us‐
599 ing buildah run will default to being run in their own user namespaces,
600 configured using the UID and GID maps.
601
602
603 Entries in this map take the form of one or more triples of a starting
604 in-container GID, a corresponding starting host-level GID, and the num‐
605 ber of consecutive IDs which the map entry represents.
606
607
608 This option overrides the remap-gids setting in the options section of
609 /etc/containers/storage.conf.
610
611
612 If this option is not specified, but a global --userns-gid-map setting
613 is supplied, settings from the global option will be used.
614
615
616 If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-
617 gid-map are specified, but --userns-uid-map is specified, the GID map
618 will be set to use the same numeric values as the UID map.
619
620
621 NOTE: When this option is specified by a rootless user, the specified
622 mappings are relative to the rootless usernamespace in the container,
623 rather than being relative to the host as it would be when run rootful.
624
625
626 --userns-gid-map-group group
627
628
629 Specifies that a GID mapping which should be used to set ownership, at
630 the filesystem level, on the container's contents, can be found in en‐
631 tries in the /etc/subgid file which correspond to the specified group.
632 Commands run using buildah run will default to being run in their own
633 user namespaces, configured using the UID and GID maps. If --userns-
634 uid-map-user is specified, but --userns-gid-map-group is not specified,
635 Buildah will assume that the specified user name is also a suitable
636 group name to use as the default setting for this option.
637
638
639 --userns-uid-map-user mapping
640
641
642 Directly specifies a UID mapping which should be used to set ownership,
643 at the filesystem level, on the container's contents. Commands run us‐
644 ing buildah run will default to being run in their own user namespaces,
645 configured using the UID and GID maps.
646
647
648 Entries in this map take the form of one or more triples of a starting
649 in-container UID, a corresponding starting host-level UID, and the num‐
650 ber of consecutive IDs which the map entry represents.
651
652
653 This option overrides the remap-uids setting in the options section of
654 /etc/containers/storage.conf.
655
656
657 If this option is not specified, but a global --userns-uid-map setting
658 is supplied, settings from the global option will be used.
659
660
661 If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-
662 uid-map are specified, but --userns-gid-map is specified, the UID map
663 will be set to use the same numeric values as the GID map.
664
665
666 NOTE: When this option is specified by a rootless user, the specified
667 mappings are relative to the rootless usernamespace in the container,
668 rather than being relative to the host as it would be when run rootful.
669
670
671 --userns-uid-map-user user
672
673
674 Specifies that a UID mapping which should be used to set ownership, at
675 the filesystem level, on the container's contents, can be found in en‐
676 tries in the /etc/subuid file which correspond to the specified user.
677 Commands run using buildah run will default to being run in their own
678 user namespaces, configured using the UID and GID maps. If --userns-
679 gid-map-group is specified, but --userns-uid-map-user is not specified,
680 Buildah will assume that the specified group name is also a suitable
681 user name to use as the default setting for this option.
682
683
684 --uts how
685
686
687 Sets the configuration for UTS namespaces when the container is subse‐
688 quently used for buildah run. The configured value can be "" (the
689 empty string) or "container" to indicate that a new UTS namespace
690 should be created, or it can be "host" to indicate that the UTS name‐
691 space in which Buildah itself is being run should be reused, or it can
692 be the path to a UTS namespace which is already in use by another
693 process.
694
695
696 --variant=""
697
698
699 Set the architecture variant of the image to be pulled.
700
701
702 --volume, -v[=[HOST-DIR:CONTAINER-DIR[:OPTIONS]]]
703
704
705 Create a bind mount. If you specify, -v /HOST-DIR:/CONTAINER-DIR, Buil‐
706 dah
707 bind mounts /HOST-DIR in the host to /CONTAINER-DIR in the Buildah
708 container. The OPTIONS are a comma delimited list and can be: [1]
709 ⟨#Footnote1⟩
710
711
712 • [rw|ro]
713
714 • [U]
715
716 • [z|Z|O]
717
718 • [[r]shared|[r]slave|[r]private|[r]unbindable]
719
720
721
722 The CONTAINER-DIR must be an absolute path such as /src/docs. The HOST-
723 DIR must be an absolute path as well. Buildah bind-mounts the HOST-DIR
724 to the path you specify. For example, if you supply /foo as the host
725 path, Buildah copies the contents of /foo to the container filesystem
726 on the host and bind mounts that into the container.
727
728
729 You can specify multiple -v options to mount one or more mounts to a
730 container.
731
732
733 Write Protected Volume Mounts
734
735
736 You can add the :ro or :rw suffix to a volume to mount it read-only or
737 read-write mode, respectively. By default, the volumes are mounted
738 read-write. See examples.
739
740
741 Chowning Volume Mounts
742
743
744 By default, Buildah does not change the owner and group of source vol‐
745 ume directories mounted into containers. If a container is created in a
746 new user namespace, the UID and GID in the container may correspond to
747 another UID and GID on the host.
748
749
750 The :U suffix tells Buildah to use the correct host UID and GID based
751 on the UID and GID within the container, to change the owner and group
752 of the source volume.
753
754
755 Labeling Volume Mounts
756
757
758 Labeling systems like SELinux require that proper labels are placed on
759 volume content mounted into a container. Without a label, the security
760 system might prevent the processes running inside the container from
761 using the content. By default, Buildah does not change the labels set
762 by the OS.
763
764
765 To change a label in the container context, you can add either of two
766 suffixes :z or :Z to the volume mount. These suffixes tell Buildah to
767 relabel file objects on the shared volumes. The z option tells Buildah
768 that two containers share the volume content. As a result, Buildah la‐
769 bels the content with a shared content label. Shared volume labels al‐
770 low all containers to read/write content. The Z option tells Buildah
771 to label the content with a private unshared label. Only the current
772 container can use a private volume.
773
774
775 Overlay Volume Mounts
776
777
778 The :O flag tells Buildah to mount the directory from the host as a
779 temporary storage using the Overlay file system. The RUN command con‐
780 tainers are allowed to modify contents within the mountpoint and are
781 stored in the container storage in a separate directory. In Overlay FS
782 terms the source directory will be the lower, and the container storage
783 directory will be the upper. Modifications to the mount point are de‐
784 stroyed when the RUN command finishes executing, similar to a tmpfs
785 mount point.
786
787
788 Any subsequent execution of RUN commands sees the original source di‐
789 rectory content, any changes from previous RUN commands no longer ex‐
790 ist.
791
792
793 One use case of the overlay mount is sharing the package cache from the
794 host into the container to allow speeding up builds.
795
796
797 Note:
798
799
800 - The `O` flag is not allowed to be specified with the `Z` or `z` flags. Content mounted into the container is labeled with the private label.
801 On SELinux systems, labels in the source directory need to be readable by the container label. If not, SELinux container separation must be disabled for the container to work.
802 - Modification of the directory volume mounted into the container with an overlay mount can cause unexpected failures. It is recommended that you do not modify the directory until the container finishes running.
803
804
805
806 By default bind mounted volumes are private. That means any mounts done
807 inside container will not be visible on the host and vice versa. This
808 behavior can be changed by specifying a volume mount propagation prop‐
809 erty.
810
811
812 When the mount propagation policy is set to shared, any mounts com‐
813 pleted inside the container on that volume will be visible to both the
814 host and container. When the mount propagation policy is set to slave,
815 one way mount propagation is enabled and any mounts completed on the
816 host for that volume will be visible only inside of the container. To
817 control the mount propagation property of the volume use the
818 :[r]shared, :[r]slave, [r]private or [r]unbindablepropagation flag. The
819 propagation property can be specified only for bind mounted volumes and
820 not for internal volumes or named volumes. For mount propagation to
821 work on the source mount point (the mount point where source dir is
822 mounted on) it has to have the right propagation properties. For shared
823 volumes, the source mount point has to be shared. And for slave vol‐
824 umes, the source mount has to be either shared or slave. [1] ⟨#Foot‐
825 note1⟩
826
827
828 Use df <source-dir> to determine the source mount and then use findmnt
829 -o TARGET,PROPAGATION <source-mount-dir> to determine propagation prop‐
830 erties of source mount, if findmnt utility is not available, the source
831 mount point can be determined by looking at the mount entry in
832 /proc/self/mountinfo. Look at optional fields and see if any propaga‐
833 tion properties are specified. shared:X means the mount is shared,
834 master:X means the mount is slave and if nothing is there that means
835 the mount is private. [1] ⟨#Footnote1⟩
836
837
838 To change propagation properties of a mount point use the mount com‐
839 mand. For example, to bind mount the source directory /foo do mount
840 --bind /foo /foo and mount --make-private --make-shared /foo. This will
841 convert /foo into a shared mount point. The propagation properties of
842 the source mount can be changed directly. For instance if / is the
843 source mount for /foo, then use mount --make-shared / to convert / into
844 a shared mount.
845
846
848 buildah from --pull imagename
849
850
851 buildah from --pull docker://myregistry.example.com/imagename
852
853
854 buildah from docker-daemon:imagename:imagetag
855
856
857 buildah from --name mycontainer docker-archive:filename
858
859
860 buildah from oci-archive:filename
861
862
863 buildah from --name mycontainer dir:directoryname
864
865
866 buildah from --pull-always --name "mycontainer" myregistry.exam‐
867 ple.com/imagename
868
869
870 buildah from --tls-verify=false myregistry/myrepository/imagename:im‐
871 agetag
872
873
874 buildah from --creds=myusername:mypassword --cert-dir ~/auth myreg‐
875 istry/myrepository/imagename:imagetag
876
877
878 buildah from --authfile=/tmp/auths/myauths.json myregistry/myreposi‐
879 tory/imagename:imagetag
880
881
882 buildah from --memory 40m --cpu-shares 2 --cpuset-cpus 0,2 --security-
883 opt label=level:s0:c100,c200 myregistry/myrepository/imagename:imagetag
884
885
886 buildah from --ulimit nofile=1024:1028 --cgroup-parent
887 /path/to/cgroup/parent myregistry/myrepository/imagename:imagetag
888
889
890 buildah from --volume /home/test:/myvol:ro,Z myregistry/myreposi‐
891 tory/imagename:imagetag
892
893
894 buildah from -v /home/test:/myvol:z,U myregistry/myrepository/image‐
895 name:imagetag
896
897
898 buildah from -v /var/lib/yum:/var/lib/yum:O myregistry/myrepository/im‐
899 agename:imagetag
900
901
902 buildah from --arch=arm --variant v7 myregistry/myrepository/image‐
903 name:imagetag
904
905
907 BUILD_REGISTRY_SOURCES
908
909
910 BUILD_REGISTRY_SOURCES, if set, is treated as a JSON object which con‐
911 tains lists of registry names under the keys insecureRegistries,
912 blockedRegistries, and allowedRegistries.
913
914
915 When pulling an image from a registry, if the name of the registry
916 matches any of the items in the blockedRegistries list, the image pull
917 attempt is denied. If there are registries in the allowedRegistries
918 list, and the registry's name is not in the list, the pull attempt is
919 denied.
920
921
922 TMPDIR The TMPDIR environment variable allows the user to specify where
923 temporary files are stored while pulling and pushing images. Defaults
924 to '/var/tmp'.
925
926
928 registries.conf (/etc/containers/registries.conf)
929
930
931 registries.conf is the configuration file which specifies which con‐
932 tainer registries should be consulted when completing image names which
933 do not include a registry or domain portion.
934
935
936 policy.json (/etc/containers/policy.json)
937
938
939 Signature policy file. This defines the trust policy for container im‐
940 ages. Controls which container registries can be used for image, and
941 whether or not the tool should trust the images.
942
943
945 buildah(1), buildah-pull(1), buildah-login(1), docker-login(1), name‐
946 spaces(7), pid_namespaces(7), containers-policy.json(5), containers-
947 registries.conf(5), user_namespaces(7)
948
949
951 1: The Buildah project is committed to inclusivity, a core value of
952 open source. The master and slave mount propagation terminology used
953 here is problematic and divisive, and should be changed. However, these
954 terms are currently used within the Linux kernel and must be used as-is
955 at this time. When the kernel maintainers rectify this usage, Buildah
956 will follow suit immediately.
957
958
959
960buildah March 2017 buildah-from(1)