.nh .TH buildah-from "1" "March 2017" "buildah" .SH NAME .PP buildah-from - Creates a new working container, either from scratch or using a specified image as a starting point. .SH SYNOPSIS .PP \fBbuildah from\fP [\fIoptions\fP] \fIimage\fP .SH DESCRIPTION .PP Creates a working container based upon the specified image name. If the supplied image name is "scratch" a new empty container is created. Image names use a "transport":"details" format. .PP Multiple transports are supported: .PP \fBdir:\fP\fIpath\fP An existing local directory \fIpath\fP containing the manifest, layer tarballs, and signatures in individual files. This is a non-standardized format, primarily useful for debugging or noninvasive image inspection. .PP \fBdocker://\fP\fIdocker-reference\fP (Default) An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in \fB$XDG_RUNTIME_DIR/containers/auth.json\fR, which is set using \fB(buildah login)\fR\&. If XDG_RUNTIME_DIR is not set, the default is /run/containers/$UID/auth.json. If the authorization state is not found there, \fB$HOME/.docker/config.json\fR is checked, which is set using \fB(docker login)\fR\&. If \fIdocker-reference\fP does not include a registry name, \fIlocalhost\fP will be consulted first, followed by any registries named in the registries configuration. .PP \fBdocker-archive:\fP\fIpath\fP An image is retrieved as a \fBpodman load\fR formatted file. .PP \fBdocker-daemon:\fP\fIdocker-reference\fP An image \fIdocker-reference\fP stored in the docker daemon's internal storage. \fIdocker-reference\fP must include either a tag or a digest. Alternatively, when reading images, the format can also be docker-daemon:algo:digest (an image ID). .PP \fBoci:\fP\fIpath\fP\fB:\fP\fItag\fP** An image tag in a directory compliant with "Open Container Image Layout Specification" at \fIpath\fP\&. .PP \fBoci-archive:\fP\fIpath\fP\fB:\fP\fItag\fP An image \fItag\fP in a directory compliant with "Open Container Image Layout Specification" at \fIpath\fP\&. .SS DEPENDENCIES .PP Buildah resolves the path to the registry to pull from by using the /etc/containers/registries.conf file, containers-registries.conf(5). If the \fBbuildah from\fR command fails with an "image not known" error, first verify that the registries.conf file is installed and configured appropriately. .SH RETURN VALUE .PP The container ID of the container that was created. On error 1 is returned. .SH OPTIONS .PP \fB--add-host\fP=[] .PP Add a custom host-to-IP mapping (host:ip) .PP Add a line to /etc/hosts. The format is hostname:ip. The \fB--add-host\fP option can be set multiple times. .PP \fB--arch\fP="ARCH" .PP Set the ARCH of the image to be pulled to the provided value instead of using the architecture of the host. (Examples: arm, arm64, 386, amd64, ppc64le, s390x) .PP \fB--authfile\fP \fIpath\fP .PP Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. If XDG_RUNTIME_DIR is not set, the default is /run/containers/$UID/auth.json. This file is created using \fBbuildah login\fR\&. .PP If the authorization state is not found there, $HOME/.docker/config.json is checked, which is set using \fBdocker login\fR\&. .PP Note: You can also override the default path of the authentication file by setting the REGISTRY_AUTH_FILE environment variable. \fBexport REGISTRY_AUTH_FILE=path\fR .PP \fB--cap-add\fP=\fICAP_xxx\fP .PP Add the specified capability to the default set of capabilities which will be supplied for subsequent \fIbuildah run\fP invocations which use this container. Certain capabilities are granted by default; this option can be used to add more. .PP \fB--cap-drop\fP=\fICAP_xxx\fP .PP Remove the specified capability from the default set of capabilities which will be supplied for subsequent \fIbuildah run\fP invocations which use this container. The CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FOWNER, CAP_FSETID, CAP_KILL, CAP_NET_BIND_SERVICE, CAP_SETFCAP, CAP_SETGID, CAP_SETPCAP, and CAP_SETUID capabilities are granted by default; this option can be used to remove them. The list of default capabilities is managed in containers.conf(5). .PP If a capability is specified to both the \fB--cap-add\fP and \fB--cap-drop\fP options, it will be dropped, regardless of the order in which the options were given. .PP \fB--cert-dir\fP \fIpath\fP .PP Use certificates at \fIpath\fP (*\&.crt, *\&.cert, *\&.key) to connect to the registry. The default certificates directory is \fI/etc/containers/certs.d\fP\&. .PP \fB--cgroup-parent\fP="" .PP Path to cgroups under which the cgroup for the container will be created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups will be created if they do not already exist. .PP \fB--cgroupns\fP \fIhow\fP .PP Sets the configuration for IPC namespaces when the container is subsequently used for \fBbuildah run\fR\&. The configured value can be "" (the empty string) or "private" to indicate that a new cgroup namespace should be created, or it can be "host" to indicate that the cgroup namespace in which \fBbuildah\fR itself is being run should be reused. .PP \fB--cidfile\fP \fIContainerIDFile\fP .PP Write the container ID to the file. .PP \fB--cpu-period\fP=\fI0\fP .PP Limit the CPU CFS (Completely Fair Scheduler) period .PP Limit the container's CPU usage. This flag tells the kernel to restrict the container's CPU usage to the period you specify. .PP \fB--cpu-quota\fP=\fI0\fP .PP Limit the CPU CFS (Completely Fair Scheduler) quota .PP Limit the container's CPU usage. By default, containers run with the full CPU resource. This flag tells the kernel to restrict the container's CPU usage to the quota you specify. .PP \fB--cpu-shares\fP, \fB-c\fP=\fI0\fP .PP CPU shares (relative weight) .PP By default, all containers get the same proportion of CPU cycles. This proportion can be modified by changing the container's CPU share weighting relative to the weighting of all other running containers. .PP To modify the proportion from the default of 1024, use the \fB--cpu-shares\fP flag to set the weighting to 2 or higher. .PP The proportion will only apply when CPU-intensive processes are running. When tasks in one container are idle, other containers can use the left-over CPU time. The actual amount of CPU time will vary depending on the number of containers running on the system. .PP For example, consider three containers, one has a cpu-share of 1024 and two others have a cpu-share setting of 512. When processes in all three containers attempt to use 100% of CPU, the first container would receive 50% of the total CPU time. If you add a fourth container with a cpu-share of 1024, the first container only gets 33% of the CPU. The remaining containers receive 16.5%, 16.5% and 33% of the CPU. .PP On a multi-core system, the shares of CPU time are distributed over all CPU cores. Even if a container is limited to less than 100% of CPU time, it can use 100% of each individual CPU core. .PP For example, consider a system with more than three cores. If you start one container \fB{C0}\fP with \fB-c=512\fP running one process, and another container \fB{C1}\fP with \fB-c=1024\fP running two processes, this can result in the following division of CPU shares: .EX PID container CPU CPU share 100 {C0} 0 100% of CPU0 101 {C1} 1 100% of CPU1 102 {C1} 2 100% of CPU2 .EE .PP \fB--cpuset-cpus\fP="" .PP CPUs in which to allow execution (0-3, 0,1) .PP \fB--cpuset-mems\fP="" .PP Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. .PP If you have four memory nodes on your system (0-3), use \fB--cpuset-mems=0,1\fR then processes in your container will only use memory from the first two memory nodes. .PP \fB--creds\fP \fIcreds\fP .PP 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. .PP \fB--decryption-key\fP \fIkey[:passphrase]\fP .PP The [key[:passphrase]] to be used for decryption of images. Key can point to keys and/or certificates. Decryption will be tried with all keys. If the key is protected by a passphrase, it is required to be passed in the argument and omitted otherwise. .PP \fB--device\fP=\fIdevice\fP .PP Add a host device or devices under a directory to the container. The format is \fB[:][:]\fR (e.g. --device=/dev/sdc:/dev/xvdc:rwm) .PP \fB--dns\fP=[] .PP Set custom DNS servers .PP This option can be used to override the DNS configuration passed to the container. Typically this is necessary when the host DNS configuration is invalid for the container (e.g., 127.0.0.1). When this is the case the \fB--dns\fR flag is necessary for every run. .PP The special value \fBnone\fP can be specified to disable creation of /etc/resolv.conf in the container by Buildah. The /etc/resolv.conf file in the image will be used without changes. .PP \fB--dns-option\fP=[] .PP Set custom DNS options .PP \fB--dns-search\fP=[] .PP Set custom DNS search domains .PP \fB--format\fP, \fB-f\fP \fIoci\fP | \fIdocker\fP .PP Control the format for the built image's manifest and configuration data. Recognized formats include \fIoci\fP (OCI image-spec v1.0, the default) and \fIdocker\fP (version 2, using schema format 2 for the manifest). .PP Note: You can also override the default format by setting the BUILDAH_FORMAT environment variable. \fBexport BUILDAH_FORMAT=docker\fR .PP \fB--group-add\fP=\fIgroup\fP | \fIkeep-groups\fP .PP Assign additional groups to the primary user running within the container process. .RS .IP \(bu 2 \fBkeep-groups\fR is a special flag that tells Buildah to keep the supplementary group access. .RE .PP Allows container to use the user's supplementary group access. If file systems or devices are only accessible by the rootless user's group, this flag tells the OCI runtime to pass the group access into the container. Currently only available with the \fBcrun\fR OCI runtime. Note: \fBkeep-groups\fR is exclusive, other groups cannot be specified with this flag. .PP \fB--http-proxy\fP .PP By default proxy environment variables are passed into the container if set for the Buildah process. This can be disabled by setting the \fB--http-proxy\fR option to \fBfalse\fR\&. The environment variables passed in include \fBhttp_proxy\fR, \fBhttps_proxy\fR, \fBftp_proxy\fR, \fBno_proxy\fR, and also the upper case versions of those. .PP Defaults to \fBtrue\fR .PP \fB--ipc\fP \fIhow\fP .PP Sets the configuration for IPC namespaces when the container is subsequently used for \fBbuildah run\fR\&. The configured value can be "" (the empty string) or "container" to indicate that a new IPC namespace should be created, or it can be "host" to indicate that the IPC namespace in which \fBBuildah\fR itself is being run should be reused, or it can be the path to an IPC namespace which is already in use by another process. .PP \fB--isolation\fP \fItype\fP .PP Controls what type of isolation is used for running processes under \fBbuildah run\fR\&. Recognized types include \fIoci\fP (OCI-compatible runtime, the default), \fIrootless\fP (OCI-compatible runtime invoked using a modified configuration, with \fI--no-new-keyring\fP added to its \fIcreate\fP invocation, reusing the host's network and UTS namespaces, and creating private IPC, PID, mount, and user namespaces; the default for unprivileged users), and \fIchroot\fP (an internal wrapper that leans more toward chroot(1) than container technology, reusing the host's control group, network, IPC, and PID namespaces, and creating private mount and UTS namespaces, and creating user namespaces only when they're required for ID mapping). .PP Note: You can also override the default isolation type by setting the BUILDAH_ISOLATION environment variable. \fBexport BUILDAH_ISOLATION=oci\fR .PP \fB--memory\fP, \fB-m\fP="" .PP Memory limit (format: [], where unit = b, k, m or g) .PP Allows you to constrain the memory available to a container. If the host supports swap memory, then the \fB-m\fP memory setting can be larger than physical RAM. If a limit of 0 is specified (not using \fB-m\fP), the container's memory is not limited. The actual limit may be rounded up to a multiple of the operating system's page size (the value would be very large, that's millions of trillions). .PP \fB--memory-swap\fP="LIMIT" .PP A limit value equal to memory plus swap. Must be used with the \fB-m\fP (\fB--memory\fP) flag. The swap \fBLIMIT\fR should always be larger than \fB-m\fP (\fB--memory\fP) value. By default, the swap \fBLIMIT\fR will be set to double the value of --memory. .PP The format of \fBLIMIT\fR is \fB[]\fR\&. Unit can be \fBb\fR (bytes), \fBk\fR (kilobytes), \fBm\fR (megabytes), or \fBg\fR (gigabytes). If you don't specify a unit, \fBb\fR is used. Set LIMIT to \fB-1\fR to enable unlimited swap. .PP \fB--name\fP \fIname\fP .PP A \fIname\fP for the working container .PP \fB--network\fP=\fImode\fP, \fB--net\fP=\fImode\fP .PP Sets the configuration for network namespaces when the container is subsequently used for \fBbuildah run\fR\&. .PP Valid \fImode\fP values are: .RS .IP \(bu 2 \fBnone\fP: no networking. Invalid if using \fB--dns\fP, \fB--dns-opt\fP, or \fB--dns-search\fP; .IP \(bu 2 \fBhost\fP: use the host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure; .IP \(bu 2 \fBns:\fP\fIpath\fP: path to a network namespace to join; .IP \(bu 2 \fBprivate\fP: create a new namespace for the container (default) .IP \(bu 2 \fB\fP: Join the network with the given name or ID, e.g. use \fB--network mynet\fR to join the network with the name mynet. Only supported for rootful users. .IP \(bu 2 \fBslirp4netns[:OPTIONS,...]\fP: use \fBslirp4netns\fP(1) to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options, they can also be set with \fBnetwork_cmd_options\fR in containers.conf: .RS .IP \(bu 2 \fBallow_host_loopback=true|false\fP: Allow slirp4netns to reach the host loopback IP (default is 10.0.2.2 or the second IP from slirp4netns cidr subnet when changed, see the cidr option below). The default is false. .IP \(bu 2 \fBmtu=MTU\fP: Specify the MTU to use for this network. (Default is \fB65520\fR). .IP \(bu 2 \fBcidr=CIDR\fP: Specify ip range to use for this network. (Default is \fB10.0.2.0/24\fR). .IP \(bu 2 \fBenable_ipv6=true|false\fP: Enable IPv6. Default is true. (Required for \fBoutbound_addr6\fR). .IP \(bu 2 \fBoutbound_addr=INTERFACE\fP: Specify the outbound interface slirp binds to (ipv4 traffic only). .IP \(bu 2 \fBoutbound_addr=IPv4\fP: Specify the outbound ipv4 address slirp binds to. .IP \(bu 2 \fBoutbound_addr6=INTERFACE\fP: Specify the outbound interface slirp binds to (ipv6 traffic only). .IP \(bu 2 \fBoutbound_addr6=IPv6\fP: Specify the outbound ipv6 address slirp binds to. .RE .IP \(bu 2 \fBpasta[:OPTIONS,...]\fP: use \fBpasta\fP(1) to create a user-mode networking stack. .br This is only supported in rootless mode. .br By default, IPv4 and IPv6 addresses and routes, as well as the pod interface name, are copied from the host. If port forwarding isn't configured, ports are forwarded dynamically as services are bound on either side (init namespace or container namespace). Port forwarding preserves the original source IP address. Options described in pasta(1) can be specified as comma-separated arguments. .br In terms of pasta(1) options, \fB--config-net\fP is given by default, in order to configure networking when the container is started, and \fB--no-map-gw\fP is also assumed by default, to avoid direct access from container to host using the gateway address. The latter can be overridden by passing \fB--map-gw\fP in the pasta-specific options (despite not being an actual pasta(1) option). .br Also, \fB-t none\fP and \fB-u none\fP are passed to disable automatic port forwarding based on bound ports. Similarly, \fB-T none\fP and \fB-U none\fP are given to disable the same functionality from container to host. .br Some examples: .RS .IP \(bu 2 \fBpasta:--map-gw\fP: Allow the container to directly reach the host using the gateway address. .IP \(bu 2 \fBpasta:--mtu,1500\fP: Specify a 1500 bytes MTU for the \fItap\fP interface in the container. .IP \(bu 2 \fBpasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,-m,1500,--no-ndp,--no-dhcpv6,--no-dhcp\fP, equivalent to default slirp4netns(1) options: disable IPv6, assign \fB10.0.2.0/24\fR to the \fBtap0\fR interface in the container, with gateway \fB10.0.2.3\fR, enable DNS forwarder reachable at \fB10.0.2.3\fR, set MTU to 1500 bytes, disable NDP, DHCPv6 and DHCP support. .IP \(bu 2 \fBpasta:-I,tap0,--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,--no-ndp,--no-dhcpv6,--no-dhcp\fP, equivalent to default slirp4netns(1) options with Podman overrides: same as above, but leave the MTU to 65520 bytes .IP \(bu 2 \fBpasta:-t,auto,-u,auto,-T,auto,-U,auto\fP: enable automatic port forwarding based on observed bound ports from both host and container sides .IP \(bu 2 \fBpasta:-T,5201\fP: enable forwarding of TCP port 5201 from container to host, using the loopback interface instead of the tap interface for improved performance .RE .RE .PP \fB--os\fP="OS" .PP Set the OS of the image to be pulled to the provided value instead of using the current operating system of the host. .PP \fB--pid\fP \fIhow\fP .PP Sets the configuration for PID namespaces when the container is subsequently used for \fBbuildah run\fR\&. The configured value can be "" (the empty string) or "container" to indicate that a new PID namespace should be created, or it can be "host" to indicate that the PID namespace in which \fBBuildah\fR itself is being run should be reused, or it can be the path to a PID namespace which is already in use by another process. .PP \fB--platform\fP="OS/ARCH[/VARIANT]" .PP Set the OS/ARCH of the image to be pulled to the provided value instead of using the current operating system and architecture of the host (for example \fBlinux/arm\fR). .PP OS/ARCH pairs are those used by the Go Programming Language. In several cases the ARCH value for a platform differs from one produced by other tools such as the \fBarch\fR command. Valid OS and architecture name combinations are listed as values for $GOOS and $GOARCH at https://golang.org/doc/install/source#environment, and can also be found by running \fBgo tool dist list\fR\&. .PP While \fBbuildah from\fR is happy to pull an image for any platform that exists, \fBbuildah run\fR will not be able to run binaries provided by that image without the help of emulation provided by packages like \fBqemu-user-static\fR\&. .PP \fBNOTE:\fP The \fB--platform\fR option may not be used in combination with the \fB--arch\fR, \fB--os\fR, or \fB--variant\fR options. .PP \fB--pull\fP .PP When the flag is enabled or set explicitly to \fBtrue\fR (with \fI--pull=true\fP), attempt to pull the latest image from the registries listed in registries.conf if a local image does not exist or the image is newer than the one in storage. Raise an error if the image is not in any listed registry and is not present locally. .PP If the flag is disabled (with \fI--pull=false\fP), do not pull the image from the registry, use only the local version. Raise an error if the image is not present locally. .PP If the pull flag is set to \fBalways\fR (with \fI--pull=always\fP), pull the image from the first registry it is found in as listed in registries.conf. Raise an error if not found in the registries, even if the image is present locally. .PP If the pull flag is set to \fBnever\fR (with \fI--pull=never\fP), Do not pull the image from the registry, use only the local version. Raise an error if the image is not present locally. .PP Defaults to \fItrue\fP\&. .PP \fB--quiet\fP, \fB-q\fP .PP If an image needs to be pulled from the registry, suppress progress output. .PP \fB--retry\fP \fIattempts\fP .PP Number of times to retry in case of failure when performing pull of images from registry. .PP Defaults to \fB3\fR\&. .PP \fB--retry-delay\fP \fIduration\fP .PP Duration of delay between retry attempts in case of failure when performing pull of images from registry. .PP Defaults to \fB2s\fR\&. .PP \fB--security-opt\fP=[] .PP Security Options .PP "label=user:USER" : Set the label user for the container "label=role:ROLE" : Set the label role for the container "label=type:TYPE" : Set the label type for the container "label=level:LEVEL" : Set the label level for the container "label=disable" : Turn off label confinement for the container "no-new-privileges" : Not supported .PP "seccomp=unconfined" : Turn off seccomp confinement for the container "seccomp=profile.json : White listed syscalls seccomp Json file to be used as a seccomp filter .PP "apparmor=unconfined" : Turn off apparmor confinement for the container "apparmor=your-profile" : Set the apparmor confinement profile for the container .PP \fB--shm-size\fP="" .PP Size of \fB/dev/shm\fR\&. The format is \fB\fR\&. \fBnumber\fR must be greater than \fB0\fR\&. Unit is optional and can be \fBb\fR (bytes), \fBk\fR (kilobytes), \fBm\fR(megabytes), or \fBg\fR (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses \fB64m\fR\&. .PP \fB--tls-verify\fP \fIbool-value\fP .PP Require HTTPS and verification of certificates when talking to container registries (defaults to true). TLS verification cannot be used when talking to an insecure registry. .PP \fB--ulimit\fP \fItype\fP=\fIsoft-limit\fP[:\fIhard-limit\fP] .PP Specifies resource limits to apply to processes launched during \fBbuildah run\fR\&. This option can be specified multiple times. Recognized resource types include: "core": maximum core dump size (ulimit -c) "cpu": maximum CPU time (ulimit -t) "data": maximum size of a process's data segment (ulimit -d) "fsize": maximum size of new files (ulimit -f) "locks": maximum number of file locks (ulimit -x) "memlock": maximum amount of locked memory (ulimit -l) "msgqueue": maximum amount of data in message queues (ulimit -q) "nice": niceness adjustment (nice -n, ulimit -e) "nofile": maximum number of open files (ulimit -n) "nofile": maximum number of open files (1048576); when run by root "nproc": maximum number of processes (ulimit -u) "nproc": maximum number of processes (1048576); when run by root "rss": maximum size of a process's (ulimit -m) "rtprio": maximum real-time scheduling priority (ulimit -r) "rttime": maximum amount of real-time execution between blocking syscalls "sigpending": maximum number of pending signals (ulimit -i) "stack": maximum stack size (ulimit -s) .PP \fB--userns\fP \fIhow\fP .PP Sets the configuration for user namespaces when the container is subsequently used for \fBbuildah run\fR\&. The configured value can be "" (the empty string) or "container" to indicate that a new user namespace should be created, it can be "host" to indicate that the user namespace in which \fBBuildah\fR itself is being run should be reused, or it can be the path to an user namespace which is already in use by another process. .PP \fB--userns-gid-map\fP \fImapping\fP .PP Directly specifies a GID mapping which should be used to set ownership, at the filesystem level, on the working container's contents. Commands run when handling \fBRUN\fR instructions will default to being run in their own user namespaces, configured using the UID and GID maps. .PP Entries in this map take the form of one or more colon-separated triples of a starting in-container GID, a corresponding starting host-level GID, and the number of consecutive IDs which the map entry represents. .PP This option overrides the \fIremap-gids\fP setting in the \fIoptions\fP section of /etc/containers/storage.conf. .PP If this option is not specified, but a global --userns-gid-map setting is supplied, settings from the global option will be used. .PP \fB--userns-gid-map-group\fP \fImapping\fP .PP Directly specifies a GID mapping which should be used to set ownership, at the filesystem level, on the container's contents. Commands run using \fBbuildah run\fR will default to being run in their own user namespaces, configured using the UID and GID maps. .PP Entries in this map take the form of one or more triples of a starting in-container GID, a corresponding starting host-level GID, and the number of consecutive IDs which the map entry represents. .PP This option overrides the \fIremap-gids\fP setting in the \fIoptions\fP section of /etc/containers/storage.conf. .PP If this option is not specified, but a global --userns-gid-map setting is supplied, settings from the global option will be used. .PP If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-gid-map are specified, but --userns-uid-map is specified, the GID map will be set to use the same numeric values as the UID map. .PP \fBNOTE:\fP When this option is specified by a rootless user, the specified mappings are relative to the rootless usernamespace in the container, rather than being relative to the host as it would be when run rootful. .PP \fB--userns-gid-map-group\fP \fIgroup\fP .PP Specifies that a GID mapping which should be used to set ownership, at the filesystem level, on the container's contents, can be found in entries in the \fB/etc/subgid\fR file which correspond to the specified group. Commands run using \fBbuildah run\fR will default to being run in their own user namespaces, configured using the UID and GID maps. If --userns-uid-map-user is specified, but --userns-gid-map-group is not specified, \fBBuildah\fR will assume that the specified user name is also a suitable group name to use as the default setting for this option. .PP \fB--userns-uid-map\fP \fImapping\fP .PP Directly specifies a UID mapping which should be used to set ownership, at the filesystem level, on the working container's contents. Commands run when handling \fBRUN\fR instructions will default to being run in their own user namespaces, configured using the UID and GID maps. .PP Entries in this map take the form of one or more colon-separated triples of a starting in-container UID, a corresponding starting host-level UID, and the number of consecutive IDs which the map entry represents. .PP This option overrides the \fIremap-uids\fP setting in the \fIoptions\fP section of /etc/containers/storage.conf. .PP If this option is not specified, but a global --userns-uid-map setting is supplied, settings from the global option will be used. .PP \fB--userns-uid-map-user\fP \fImapping\fP .PP Directly specifies a UID mapping which should be used to set ownership, at the filesystem level, on the container's contents. Commands run using \fBbuildah run\fR will default to being run in their own user namespaces, configured using the UID and GID maps. .PP Entries in this map take the form of one or more triples of a starting in-container UID, a corresponding starting host-level UID, and the number of consecutive IDs which the map entry represents. .PP This option overrides the \fIremap-uids\fP setting in the \fIoptions\fP section of /etc/containers/storage.conf. .PP If this option is not specified, but a global --userns-uid-map setting is supplied, settings from the global option will be used. .PP If none of --userns-uid-map-user, --userns-gid-map-group, or --userns-uid-map are specified, but --userns-gid-map is specified, the UID map will be set to use the same numeric values as the GID map. .PP \fBNOTE:\fP When this option is specified by a rootless user, the specified mappings are relative to the rootless usernamespace in the container, rather than being relative to the host as it would be when run rootful. .PP \fB--userns-uid-map-user\fP \fIuser\fP .PP Specifies that a UID mapping which should be used to set ownership, at the filesystem level, on the container's contents, can be found in entries in the \fB/etc/subuid\fR file which correspond to the specified user. Commands run using \fBbuildah run\fR will default to being run in their own user namespaces, configured using the UID and GID maps. If --userns-gid-map-group is specified, but --userns-uid-map-user is not specified, \fBBuildah\fR will assume that the specified group name is also a suitable user name to use as the default setting for this option. .PP \fB--uts\fP \fIhow\fP .PP Sets the configuration for UTS namespaces when the container is subsequently used for \fBbuildah run\fR\&. The configured value can be "" (the empty string) or "container" to indicate that a new UTS namespace should be created, or it can be "host" to indicate that the UTS namespace in which \fBBuildah\fR itself is being run should be reused, or it can be the path to a UTS namespace which is already in use by another process. .PP \fB--variant\fP="" .PP Set the architecture variant of the image to be pulled. .PP \fB--volume\fP, \fB-v\fP[=\fI[HOST-DIR:CONTAINER-DIR[:OPTIONS]]\fP] .PP Create a bind mount. If you specify, \fB-v /HOST-DIR:/CONTAINER-DIR\fR, Buildah bind mounts \fB/HOST-DIR\fR in the host to \fB/CONTAINER-DIR\fR in the Buildah container. The \fBOPTIONS\fR are a comma delimited list and can be: [1] \[la]#Footnote1\[ra] .RS .IP \(bu 2 [rw|ro] .IP \(bu 2 [U] .IP \(bu 2 [z|Z|O] .IP \(bu 2 [\fB[r]shared\fR|\fB[r]slave\fR|\fB[r]private\fR|\fB[r]unbindable\fR] .RE .PP The \fBCONTAINER-DIR\fR must be an absolute path such as \fB/src/docs\fR\&. The \fBHOST-DIR\fR must be an absolute path as well. Buildah bind-mounts the \fBHOST-DIR\fR to the path you specify. For example, if you supply \fB/foo\fR as the host path, Buildah copies the contents of \fB/foo\fR to the container filesystem on the host and bind mounts that into the container. .PP You can specify multiple \fB-v\fP options to mount one or more mounts to a container. .PP \fBWrite Protected Volume Mounts\fR .PP You can add the \fB:ro\fR or \fB:rw\fR suffix to a volume to mount it read-only or read-write mode, respectively. By default, the volumes are mounted read-write. See examples. .PP \fBChowning Volume Mounts\fR .PP By default, Buildah does not change the owner and group of source volume directories mounted into containers. If a container is created in a new user namespace, the UID and GID in the container may correspond to another UID and GID on the host. .PP The \fB:U\fR suffix tells Buildah to use the correct host UID and GID based on the UID and GID within the container, to change the owner and group of the source volume. .PP \fBLabeling Volume Mounts\fR .PP Labeling systems like SELinux require that proper labels are placed on volume content mounted into a container. Without a label, the security system might prevent the processes running inside the container from using the content. By default, Buildah does not change the labels set by the OS. .PP To change a label in the container context, you can add either of two suffixes \fB:z\fR or \fB:Z\fR to the volume mount. These suffixes tell Buildah to relabel file objects on the shared volumes. The \fBz\fR option tells Buildah that two containers share the volume content. As a result, Buildah labels the content with a shared content label. Shared volume labels allow all containers to read/write content. The \fBZ\fR option tells Buildah to label the content with a private unshared label. Only the current container can use a private volume. .PP \fBOverlay Volume Mounts\fR .PP The \fB:O\fR flag tells Buildah to mount the directory from the host as a temporary storage using the Overlay file system. The \fBRUN\fR command containers are allowed to modify contents within the mountpoint and are stored in the container storage in a separate directory. In Overlay FS terms the source directory will be the lower, and the container storage directory will be the upper. Modifications to the mount point are destroyed when the \fBRUN\fR command finishes executing, similar to a tmpfs mount point. .PP Any subsequent execution of \fBRUN\fR commands sees the original source directory content, any changes from previous RUN commands no longer exist. .PP One use case of the \fBoverlay\fR mount is sharing the package cache from the host into the container to allow speeding up builds. .PP Note: .RS .IP \(bu 2 The \fBO\fR flag is not allowed to be specified with the \fBZ\fR or \fBz\fR flags. Content mounted into the container is labeled with the private label. 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. .IP \(bu 2 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. .RE .PP By default bind mounted volumes are \fBprivate\fR\&. That means any mounts done inside container will not be visible on the host and vice versa. This behavior can be changed by specifying a volume mount propagation property. .PP When the mount propagation policy is set to \fBshared\fR, any mounts completed inside the container on that volume will be visible to both the host and container. When the mount propagation policy is set to \fBslave\fR, one way mount propagation is enabled and any mounts completed on the host for that volume will be visible only inside of the container. To control the mount propagation property of the volume use the \fB:[r]shared\fR, \fB:[r]slave\fR, \fB[r]private\fR or \fB[r]unbindable\fRpropagation flag. The propagation property can be specified only for bind mounted volumes and not for internal volumes or named volumes. For mount propagation to work on the source mount point (the mount point where source dir is mounted on) it has to have the right propagation properties. For shared volumes, the source mount point has to be shared. And for slave volumes, the source mount has to be either shared or slave. [1] \[la]#Footnote1\[ra] .PP Use \fBdf \fR to determine the source mount and then use \fBfindmnt -o TARGET,PROPAGATION \fR to determine propagation properties of source mount, if \fBfindmnt\fR utility is not available, the source mount point can be determined by looking at the mount entry in \fB/proc/self/mountinfo\fR\&. Look at \fBoptional fields\fR and see if any propagation properties are specified. \fBshared:X\fR means the mount is \fBshared\fR, \fBmaster:X\fR means the mount is \fBslave\fR and if nothing is there that means the mount is \fBprivate\fR\&. [1] \[la]#Footnote1\[ra] .PP To change propagation properties of a mount point use the \fBmount\fR command. For example, to bind mount the source directory \fB/foo\fR do \fBmount --bind /foo /foo\fR and \fBmount --make-private --make-shared /foo\fR\&. This will convert /foo into a \fBshared\fR mount point. The propagation properties of the source mount can be changed directly. For instance if \fB/\fR is the source mount for \fB/foo\fR, then use \fBmount --make-shared /\fR to convert \fB/\fR into a \fBshared\fR mount. .SH EXAMPLE .PP buildah from --pull imagename .PP buildah from --pull docker://myregistry.example.com/imagename .PP buildah from docker-daemon:imagename:imagetag .PP buildah from --name mycontainer docker-archive:filename .PP buildah from oci-archive:filename .PP buildah from --name mycontainer dir:directoryname .PP buildah from --pull-always --name "mycontainer" myregistry.example.com/imagename .PP buildah from --tls-verify=false myregistry/myrepository/imagename:imagetag .PP buildah from --creds=myusername:mypassword --cert-dir ~/auth myregistry/myrepository/imagename:imagetag .PP buildah from --authfile=/tmp/auths/myauths.json myregistry/myrepository/imagename:imagetag .PP buildah from --memory 40m --cpu-shares 2 --cpuset-cpus 0,2 --security-opt label=level:s0:c100,c200 myregistry/myrepository/imagename:imagetag .PP buildah from --ulimit nofile=1024:1028 --cgroup-parent /path/to/cgroup/parent myregistry/myrepository/imagename:imagetag .PP buildah from --volume /home/test:/myvol:ro,Z myregistry/myrepository/imagename:imagetag .PP buildah from -v /home/test:/myvol:z,U myregistry/myrepository/imagename:imagetag .PP buildah from -v /var/lib/yum:/var/lib/yum:O myregistry/myrepository/imagename:imagetag .PP buildah from --arch=arm --variant v7 myregistry/myrepository/imagename:imagetag .SH ENVIRONMENT .PP \fBBUILD_REGISTRY_SOURCES\fP .PP BUILD_REGISTRY_SOURCES, if set, is treated as a JSON object which contains lists of registry names under the keys \fBinsecureRegistries\fR, \fBblockedRegistries\fR, and \fBallowedRegistries\fR\&. .PP When pulling an image from a registry, if the name of the registry matches any of the items in the \fBblockedRegistries\fR list, the image pull attempt is denied. If there are registries in the \fBallowedRegistries\fR list, and the registry's name is not in the list, the pull attempt is denied. .PP \fBTMPDIR\fP The TMPDIR environment variable allows the user to specify where temporary files are stored while pulling and pushing images. Defaults to '/var/tmp'. .SH FILES .PP \fBregistries.conf\fP (\fB/etc/containers/registries.conf\fR) .PP registries.conf is the configuration file which specifies which container registries should be consulted when completing image names which do not include a registry or domain portion. .PP \fBpolicy.json\fP (\fB/etc/containers/policy.json\fR) .PP Signature policy file. This defines the trust policy for container images. Controls which container registries can be used for image, and whether or not the tool should trust the images. .SH SEE ALSO .PP buildah(1), buildah-pull(1), buildah-login(1), docker-login(1), namespaces(7), pid_namespaces(7), containers-policy.json(5), containers-registries.conf(5), user_namespaces(7), containers.conf(5) .SH FOOTNOTES .PP 1: The Buildah project is committed to inclusivity, a core value of open source. The \fBmaster\fR and \fBslave\fR mount propagation terminology used here is problematic and divisive, and should be changed. However, these terms are currently used within the Linux kernel and must be used as-is at this time. When the kernel maintainers rectify this usage, Buildah will follow suit immediately.