.nh .TH podman\-run(1) .SH NAME .PP podman\-run \- Run a command in a new container .SH SYNOPSIS .PP \fBpodman run\fP [\fIoptions\fP] \fIimage\fP [\fIcommand\fP [\fIarg\fP ...]] .PP \fBpodman container run\fP [\fIoptions\fP] \fIimage\fP [\fIcommand\fP [\fIarg\fP ...]] .SH DESCRIPTION .PP Run a process in a new container. \fBpodman run\fP starts a process with its own file system, its own networking, and its own isolated process tree. The \fIimage\fP which starts the process may define defaults related to the process that will be run in the container, the networking to expose, and more, but \fBpodman run\fP gives final control to the operator or administrator who starts the container from the image. For that reason \fBpodman run\fP has more options than any other Podman command. .PP If the \fIimage\fP is not already loaded then \fBpodman run\fP will pull the \fIimage\fP, and all image dependencies, from the repository in the same way running \fBpodman pull\fP \fIimage\fP , before it starts the container from that image. .PP Several files will be automatically created within the container. These include \fI/etc/hosts\fP, \fI/etc/hostname\fP, and \fI/etc/resolv.conf\fP to manage networking. These will be based on the host's version of the files, though they can be customized with options (for example, \fB\-\-dns\fP will override the host's DNS servers in the created \fIresolv.conf\fP). Additionally, a container environment file is created in each container to indicate to programs they are running in a container. This file is located at \fI/run/.containerenv\fP\&. When using the \-\&\-\&privileged flag the .containerenv contains name/value pairs indicating the container engine version, whether the engine is running in rootless mode, the container name and id, as well as the image name and id that the container is based on. .PP When running from a user defined network namespace, the \fI/etc/netns/NSNAME/resolv.conf\fP will be used if it exists, otherwise \fI/etc/resolv.conf\fP will be used. .PP Default settings are defined in \fB\fCcontainers.conf\fR\&. Most settings for remote connections use the servers containers.conf, except when documented in man pages. .SH IMAGE .PP The image is specified using transport:path format. If no transport is specified, the \fB\fCdocker\fR (container registry) transport will be used by default. For remote Podman, \fB\fCdocker\fR is the only allowed transport. .PP \fBdir:\fP\fIpath\fP An existing local directory \fIpath\fP storing the manifest, layer tarballs and signatures as individual files. This is a non\-standardized format, primarily useful for debugging or noninvasive container inspection. .PP .RS .nf $ podman save \-\-format docker\-dir fedora \-o /tmp/fedora $ podman run dir:/tmp/fedora echo hello .fi .RE .PP \fBdocker://\fP\fIdocker\-reference\fP (Default) An image reference stored in a remote container image registry. Example: "quay.io/podman/stable:latest". The reference can include a path to a specific registry; if it does not, the registries listed in registries.conf will be queried to find a matching image. By default, credentials from \fB\fCpodman login\fR (stored at $XDG\_RUNTIME\_DIR/containers/auth.json by default) will be used to authenticate; otherwise it falls back to using credentials in $HOME/.docker/config.json. .PP .RS .nf $ podman run registry.fedoraproject.org/fedora:latest echo hello .fi .RE .PP \fBdocker\-archive:\fP\fIpath\fP[\fB:\fP\fIdocker\-reference\fP] An image stored in the \fB\fCdocker save\fR formatted file. \fIdocker\-reference\fP is only used when creating such a file, and it must not contain a digest. .PP .RS .nf $ podman save \-\-format docker\-archive fedora \-o /tmp/fedora $ podman run docker\-archive:/tmp/fedora echo hello .fi .RE .PP \fBdocker\-daemon:\fP\fIdocker\-reference\fP An image in \fIdocker\-reference\fP format stored in the docker daemon internal storage. The \fIdocker\-reference\fP can also be an image ID (docker\-daemon:algo:digest). .PP .RS .nf $ sudo docker pull fedora $ sudo podman run docker\-daemon:docker.io/library/fedora echo hello .fi .RE .PP \fBoci\-archive:\fP\fIpath\fP\fB:\fP\fItag\fP An image in a directory compliant with the "Open Container Image Layout Specification" at the specified \fIpath\fP and specified with a \fItag\fP\&. .PP .RS .nf $ podman save \-\-format oci\-archive fedora \-o /tmp/fedora $ podman run oci\-archive:/tmp/fedora echo hello .fi .RE .SH OPTIONS .SS \fB\-\-add\-host\fP=\fIhost\fP:\fIip\fP .PP Add a line to container's \fI/etc/hosts\fP for custom host\-to\-IP mapping. This option can be set multiple times. .SS \fB\-\-annotation\fP=\fIkey\fP=\fIvalue\fP .PP Add an annotation to the container. This option can be set multiple times. .SS \fB\-\-arch\fP=\fIARCH\fP .PP Override the architecture, defaults to hosts, of the image to be pulled. For example, \fB\fCarm\fR\&. .SS \fB\-\-attach\fP, \fB\-a\fP=\fBstdin\fP|\fBstdout\fP|\fBstderr\fP .PP Attach to STDIN, STDOUT or STDERR. .PP In foreground mode (the default when \fB\-d\fP is not specified), \fBpodman run\fP can start the process in the container and attach the console to the process's standard input, output, and error. It can even pretend to be a TTY (this is what most commandline executables expect) and pass along signals. The \fB\-a\fP option can be set for each of \fBstdin\fP, \fBstdout\fP, and \fBstderr\fP\&. .SS \fB\-\-authfile\fP[=\fIpath\fP] .PP Path to the authentication file. Default is \fI${XDG\_RUNTIME\_DIR}/containers/auth.json\fP\&. .PP Note: You can also override the default path of the authentication file by setting the \fBREGISTRY\_AUTH\_FILE\fP environment variable. .SS \fB\-\-blkio\-weight\fP=\fIweight\fP .PP Block IO relative weight. The \fIweight\fP is a value between \fB10\fP and \fB1000\fP\&. .SS \fB\-\-blkio\-weight\-device\fP=\fIdevice\fP:\fIweight\fP .PP Block IO relative device weight. .SS \fB\-\-cap\-add\fP=\fIcapability\fP .PP Add Linux capabilities. .SS \fB\-\-cap\-drop\fP=\fIcapability\fP .PP Drop Linux capabilities. .SS \fB\-\-cgroupns\fP=\fImode\fP .PP Set the cgroup namespace mode for the container. .RS .IP \(bu 2 \fBhost\fP: use the host's cgroup namespace inside the container. .IP \(bu 2 \fBcontainer:\fP\fIid\fP: join the namespace of the specified container. .IP \(bu 2 \fBprivate\fP: create a new cgroup namespace. .IP \(bu 2 \fBns:\fP\fIpath\fP: join the namespace at the specified path. .RE .PP If the host uses cgroups v1, the default is set to \fBhost\fP\&. On cgroups v2, the default is \fBprivate\fP\&. .SS \fB\-\-cgroups\fP=\fBenabled\fP|\fBdisabled\fP|\fBno\-conmon\fP|\fBsplit\fP .PP Determines whether the container will create CGroups. .PP Default is \fBenabled\fP\&. .PP The \fBenabled\fP option will create a new cgroup under the cgroup\-parent. The \fBdisabled\fP option will force the container to not create CGroups, and thus conflicts with CGroup options (\fB\-\-cgroupns\fP and \fB\-\-cgroup\-parent\fP). The \fBno\-conmon\fP option disables a new CGroup only for the \fBconmon\fP process. The \fBsplit\fP option splits the current cgroup in two sub\-cgroups: one for conmon and one for the container payload. It is not possible to set \fB\-\-cgroup\-parent\fP with \fBsplit\fP\&. .SS \fB\-\-cgroup\-parent\fP=\fIpath\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. .SS \fB\-\-cgroup\-conf\fP=\fIKEY=VALUE\fP .PP When running on cgroup v2, specify the cgroup file to write to and its value. For example \fB\-\-cgroup\-conf=memory.high=1073741824\fP sets the memory.high limit to 1GB. .SS \fB\-\-cidfile\fP=\fIfile\fP .PP Write the container ID to \fIfile\fP\&. .SS \fB\-\-conmon\-pidfile\fP=\fIfile\fP .PP Write the pid of the \fBconmon\fP process to a file. As \fBconmon\fP runs in a separate process than Podman, this is necessary when using systemd to restart Podman containers. .SS \fB\-\-cpu\-period\fP=\fIlimit\fP .PP Set the CPU period for the Completely Fair Scheduler (CFS), which is a duration in microseconds. Once the container's CPU quota is used up, it will not be scheduled to run until the current period ends. Defaults to 100000 microseconds. .PP On some systems, changing the CPU limits may not be allowed for non\-root users. For more details, see https://github.com/containers/podman/blob/master/troubleshooting.md#26\-running\-containers\-with\-cpu\-limits\-fails\-with\-a\-permissions\-error .SS \fB\-\-cpu\-quota\fP=\fIlimit\fP .PP Limit the CPU Completely Fair Scheduler (CFS) quota. .PP Limit the container's CPU usage. By default, containers run with the full CPU resource. The limit is a number in microseconds. If you provide a number, the container will be allowed to use that much CPU time until the CPU period ends (controllable via \fB\-\-cpu\-period\fP). .PP On some systems, changing the CPU limits may not be allowed for non\-root users. For more details, see https://github.com/containers/podman/blob/master/troubleshooting.md#26\-running\-containers\-with\-cpu\-limits\-fails\-with\-a\-permissions\-error .SS \fB\-\-cpu\-rt\-period\fP=\fImicroseconds\fP .PP Limit the CPU real\-time period in microseconds. .PP Limit the container's Real Time CPU usage. This flag tell the kernel to restrict the container's Real Time CPU usage to the period you specify. .SS \fB\-\-cpu\-rt\-runtime\fP=\fImicroseconds\fP .PP Limit the CPU real\-time runtime in microseconds. .PP Limit the containers Real Time CPU usage. This flag tells the kernel to limit the amount of time in a given CPU period Real Time tasks may consume. Ex: Period of 1,000,000us and Runtime of 950,000us means that this container could consume 95% of available CPU and leave the remaining 5% to normal priority tasks. .PP The sum of all runtimes across containers cannot exceed the amount allotted to the parent cgroup. .SS \fB\-\-cpu\-shares\fP=\fIshares\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 combined weight of all the running containers. Default weight is \fB1024\fP\&. .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\-\-cpu\-shares=512\fP running one process, and another container \fB{C1}\fP with \fB\-\-cpu\-shares=1024\fP running two processes, this can result in the following division of CPU shares: .TS allbox; l l l l l l l l . \fB\fCPID\fR \fB\fCcontainer\fR \fB\fCCPU\fR \fB\fCCPU share\fR 100 {C0} 0 100% of CPU0 101 {C1} 1 100% of CPU1 102 {C1} 2 100% of CPU2 .TE .SS \fB\-\-cpus\fP=\fInumber\fP .PP Number of CPUs. The default is \fI0.0\fP which means no limit. This is shorthand for \fB\-\-cpu\-period\fP and \fB\-\-cpu\-quota\fP, so you may only set either .SS \fB\-\-cpus\fP or \fB\-\-cpu\-period\fP and \fB\-\-cpu\-quota\fP\&. .PP On some systems, changing the CPU limits may not be allowed for non\-root users. For more details, see https://github.com/containers/podman/blob/master/troubleshooting.md#26\-running\-containers\-with\-cpu\-limits\-fails\-with\-a\-permissions\-error .SS \fB\-\-cpuset\-cpus\fP=\fInumber\fP .PP CPUs in which to allow execution. Can be specified as a comma\-separated list (e.g. \fB0,1\fP), as a range (e.g. \fB0\-3\fP), or any combination thereof (e.g. \fB0\-3,7,11\-15\fP). .SS \fB\-\-cpuset\-mems\fP=\fInodes\fP .PP Memory nodes (MEMs) in which to allow execution. Only effective on NUMA systems. .PP For example, if you have four memory nodes (0\-3) on your system, use \fB\-\-cpuset\-mems=0,1\fP to only use memory from the first two memory nodes. .SS \fB\-\-detach\fP, \fB\-d\fP=\fBtrue\fP|\fBfalse\fP .PP Detached mode: run the container in the background and print the new container ID. The default is \fIfalse\fP\&. .PP At any time you can run \fBpodman ps\fP in the other shell to view a list of the running containers. You can reattach to a detached container with \fBpodman attach\fP\&. .PP When attached in the tty mode, you can detach from the container (and leave it running) using a configurable key sequence. The default sequence is \fB\fCctrl\-p,ctrl\-q\fR\&. Configure the keys sequence using the \fB\-\-detach\-keys\fP option, or specifying it in the \fBcontainers.conf\fP file: see \fBcontainers.conf(5)\fP for more information. .SS \fB\-\-detach\-keys\fP=\fIsequence\fP .PP Specify the key sequence for detaching a container. Format is a single character \fB\fC[a\-Z]\fR or one or more \fB\fCctrl\-\fR characters where \fB\fC\fR is one of: \fB\fCa\-z\fR, \fB\fC@\fR, \fB\fC^\fR, \fB\fC[\fR, \fB\fC,\fR or \fB\fC\_\fR\&. Specifying "" will disable this feature. The default is \fIctrl\-p,ctrl\-q\fP\&. .PP This option can also be set in \fBcontainers.conf\fP(5) file. .PP Specifying "" will disable this feature. The default is \fBctrl\-p,ctrl\-q\fP\&. .SS \fB\-\-device\fP=\fIhost\-device\fP[\fB:\fP\fIcontainer\-device\fP][\fB:\fP\fIpermissions\fP] .PP Add a host device to the container. Optional \fIpermissions\fP parameter can be used to specify device permissions, it is combination of \fBr\fP for read, \fBw\fP for write, and \fBm\fP for \fBmknod\fP(2). .PP Example: \fB\-\-device=/dev/sdc:/dev/xvdc:rwm\fP\&. .PP Note: if \_host\fIdevice\fP is a symbolic link then it will be resolved first. The container will only store the major and minor numbers of the host device. .PP Note: if the user only has access rights via a group, accessing the device from inside a rootless container will fail. The \fBcrun\fP(1) runtime offers a workaround for this by adding the option \fB\-\-annotation run.oci.keep\_original\_groups=1\fP\&. .PP Podman may load kernel modules required for using the specified device. The devices that Podman will load modules when necessary are: /dev/fuse. .SS \fB\-\-device\-cgroup\-rule\fP=rule .PP Add a rule to the cgroup allowed devices list .SS \fB\-\-device\-read\-bps\fP=\fIpath\fP:\fIrate\fP .PP Limit read rate (in bytes per second) from a device (e.g. \fB\-\-device\-read\-bps=/dev/sda:1mb\fP). .SS \fB\-\-device\-read\-iops\fP=\fIpath\fP:\fIrate\fP .PP Limit read rate (in IO operations per second) from a device (e.g. \fB\-\-device\-read\-iops=/dev/sda:1000\fP). .SS \fB\-\-device\-write\-bps\fP=\fIpath\fP:\fIrate\fP .PP Limit write rate (in bytes per second) to a device (e.g. \fB\-\-device\-write\-bps=/dev/sda:1mb\fP). .SS \fB\-\-device\-write\-iops\fP=\fIpath\fP:\fIrate\fP .PP Limit write rate (in IO operations per second) to a device (e.g. \fB\-\-device\-write\-iops=/dev/sda:1000\fP). .SS \fB\-\-disable\-content\-trust\fP .PP This is a Docker specific option to disable image verification to a Docker registry and is not supported by Podman. This flag is a NOOP and provided solely for scripting compatibility. .SS \fB\-\-dns\fP=\fIipaddr\fP .PP Set custom DNS servers. Invalid if using \fB\-\-dns\fP with \fB\-\-network\fP that is set to \fBnone\fP or \fBcontainer:\fP\fIid\fP\&. .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., \fB127.0.0.1\fP). When this is the case the \fB\-\-dns\fP flags is necessary for every run. .PP The special value \fBnone\fP can be specified to disable creation of \fI/etc/resolv.conf\fP in the container by Podman. The \fI/etc/resolv.conf\fP file in the image will be used without changes. .SS \fB\-\-dns\-opt\fP=\fIoption\fP .PP Set custom DNS options. Invalid if using \fB\-\-dns\-opt\fP with \fB\-\-network\fP that is set to \fBnone\fP or \fBcontainer:\fP\fIid\fP\&. .SS \fB\-\-dns\-search\fP=\fIdomain\fP .PP Set custom DNS search domains. Invalid if using \fB\-\-dns\-search\fP and \fB\-\-network\fP that is set to \fBnone\fP or \fBcontainer:\fP\fIid\fP\&. Use \fB\-\-dns\-search=.\fP if you don't wish to set the search domain. .SS \fB\-\-entrypoint\fP=\fI"command"\fP | \fI\&'["command", "arg1", ...]'\fP .PP Overwrite the default ENTRYPOINT of the image. .PP This option allows you to overwrite the default entrypoint of the image. .PP The ENTRYPOINT of an image is similar to a COMMAND because it specifies what executable to run when the container starts, but it is (purposely) more difficult to override. The ENTRYPOINT gives a container its default nature or behavior, so that when you set an ENTRYPOINT you can run the container as if it were that binary, complete with default options, and you can pass in more options via the COMMAND. But, sometimes an operator may want to run something else inside the container, so you can override the default ENTRYPOINT at runtime by using a \fB\-\-entrypoint\fP and a string to specify the new ENTRYPOINT. .PP You need to specify multi option commands in the form of a json string. .SS \fB\-\-env\fP, \fB\-e\fP=\fIenv\fP .PP Set environment variables. .PP This option allows arbitrary environment variables that are available for the process to be launched inside of the container. If an environment variable is specified without a value, Podman will check the host environment for a value and set the variable only if it is set on the host. If an environment variable ending in \fB*\fP is specified, Podman will search the host environment for variables starting with the prefix and will add those variables to the container. If an environment variable with a trailing ***** is specified, then a value must be supplied. .PP See \fBEnvironment\fP \[la]#environment\[ra] note below for precedence and examples. .SS \fB\-\-env\-host\fP=\fBtrue\fP|\fBfalse\fP .PP Use host environment inside of the container. See \fBEnvironment\fP note below for precedence. (Not available for remote commands) .SS \fB\-\-env\-file\fP=\fIfile\fP .PP Read in a line delimited file of environment variables. See \fBEnvironment\fP note below for precedence. .SS \fB\-\-expose\fP=\fIport\fP .PP Expose a port, or a range of ports (e.g. \fB\-\-expose=3300\-3310\fP) to set up port redirection on the host system. .SS \fB\-\-gidmap\fP=\fIcontainer\_gid\fP:\fIhost\_gid\fP:\fIamount\fP .PP Run the container in a new user namespace using the supplied mapping. This option conflicts with the \fB\-\-userns\fP and \fB\-\-subgidname\fP flags. This option can be passed several times to map different ranges. If calling \fBpodman run\fP as an unprivileged user, the user needs to have the right to use the mapping. See \fBsubuid\fP(5). The example maps gids \fB0\-1999\fP in the container to the gids \fB30000\-31999\fP on the host: \fB\-\-gidmap=0:30000:2000\fP\&. .PP \fBImportant note:\fP The new user namespace mapping based on \fB\-\-gidmap\fP is based on the initial mapping made in the \fI/etc/subgid\fP file. Assuming there is a \fI/etc/subgid\fP mapping \fBgroupname:100000:65536\fP, then \fBgroupname\fP is initially mapped to a namespace starting with gid \fB100000\fP for \fB65536\fP ids. From here the \fB\-\-gidmap\fP mapping to the new namespace starts from \fB0\fP again, but is based on the initial mapping. Meaning \fBgroupname\fP is initially mapped to gid \fB100000\fP which is referenced as \fB0\fP in the following \fB\-\-gidmap\fP mapping. In terms of the example above: The group \fBgroupname\fP is mapped to group \fB100000\fP of the initial namespace then the \fB30000\fPst id of this namespace (which is gid 130000 in this namespace) is mapped to container namespace group id \fB0\fP\&. (groupname \-\&> 100000 / 30000 \-\&> 0) .SS \fB\-\-group\-add\fP=\fIgroup\fP .PP Add additional groups to run as .SS \fB\-\-health\-cmd\fP=\fI"command"\fP | \fI\&'["command", "arg1", ...]'\fP .PP Set or alter a healthcheck command for a container. The command is a command to be executed inside your container that determines your container health. The command is required for other healthcheck options to be applied. A value of \fBnone\fP disables existing healthchecks. .PP Multiple options can be passed in the form of a JSON array; otherwise, the command will be interpreted as an argument to \fB/bin/sh \-c\fP\&. .SS \fB\-\-health\-interval\fP=\fIinterval\fP .PP Set an interval for the healthchecks. An \fIinterval\fP of \fBdisable\fP results in no automatic timer setup. The default is \fB30s\fP\&. .SS \fB\-\-health\-retries\fP=\fIretries\fP .PP The number of retries allowed before a healthcheck is considered to be unhealthy. The default value is \fB3\fP\&. .SS \fB\-\-health\-start\-period\fP=\fIperiod\fP .PP The initialization time needed for a container to bootstrap. The value can be expressed in time format like \fB2m3s\fP\&. The default value is \fB0s\fP\&. .SS \fB\-\-health\-timeout\fP=\fItimeout\fP .PP The maximum time allowed to complete the healthcheck before an interval is considered failed. Like start\-period, the value can be expressed in a time format such as \fB1m22s\fP\&. The default value is \fB30s\fP\&. .SS \fB\-\-help\fP .PP Print usage statement .SS \fB\-\-hostname\fP=\fIname\fP, \fB\-h\fP .PP Container host name .PP Sets the container host name that is available inside the container. Can only be used with a private UTS namespace \fB\fC\-\-uts=private\fR (default). If \fB\fC\-\-pod\fR is specified and the pod shares the UTS namespace (default) the pod's hostname will be used. .SS \fB\-\-http\-proxy\fP=\fBtrue\fP|\fBfalse\fP .PP By default proxy environment variables are passed into the container if set for the Podman process. This can be disabled by setting the value to \fBfalse\fP\&. The environment variables passed in include \fBhttp\_proxy\fP, \fBhttps\_proxy\fP, \fBftp\_proxy\fP, \fBno\_proxy\fP, and also the upper case versions of those. This option is only needed when the host system must use a proxy but the container should not use any proxy. Proxy environment variables specified for the container in any other way will override the values that would have been passed through from the host. (Other ways to specify the proxy for the container include passing the values with the \fB\-\-env\fP flag, or hard coding the proxy environment at container build time.) (Not available for remote commands) .PP Defaults to \fBtrue\fP\&. .SS \fB\-\-image\-volume\fP, \fBbuiltin\-volume\fP=\fBbind\fP|\fBtmpfs\fP|\fBignore\fP .PP Tells Podman how to handle the builtin image volumes. Default is \fBbind\fP\&. .RS .IP \(bu 2 \fBbind\fP: An anonymous named volume will be created and mounted into the container. .IP \(bu 2 \fBtmpfs\fP: The volume is mounted onto the container as a tmpfs, which allows the users to create content that disappears when the container is stopped. .IP \(bu 2 \fBignore\fP: All volumes are just ignored and no action is taken. .RE .SS \fB\-\-init\fP .PP Run an init inside the container that forwards signals and reaps processes. .SS \fB\-\-init\-path\fP=\fIpath\fP .PP Path to the container\-init binary. .SS \fB\-\-interactive\fP, \fB\-i\fP=\fBtrue\fP|\fBfalse\fP .PP When set to \fBtrue\fP, keep stdin open even if not attached. The default is \fBfalse\fP\&. .SS \fB\-\-ip6\fP=\fIip\fP .PP Not implemented. .SS \fB\-\-ip\fP=\fIip\fP .PP Specify a static IP address for the container, for example \fB10.88.64.128\fP\&. This option can only be used if the container is joined to only a single network \-\& i.e., \fB\fC\-\-network=\_network\-name\_\fR is used at most once and if the container is not joining another container's network namespace via \fB\fC\-\-network=container:\_id\_\fR\&. The address must be within the CNI network's IP address pool (default \fB10.88.0.0/16\fP). .SS \fB\-\-ipc\fP=\fImode\fP .PP Set the IPC namespace mode for a container. The default is to create a private IPC namespace. .RS .IP \(bu 2 \fBcontainer:\fP\fIid\fP: reuses another container shared memory, semaphores and message queues .IP \(bu 2 \fBhost\fP: use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure. .IP \(bu 2 \fBns:\fP\fIpath\fP: path to an IPC namespace to join. .RE .SS \fB\-\-kernel\-memory\fP=\fInumber\fP[\fIunit\fP] .PP Kernel memory limit. A \fIunit\fP can be \fBb\fP (bytes), \fBk\fP (kilobytes), \fBm\fP (megabytes), or \fBg\fP (gigabytes). .PP Constrains the kernel memory available to a container. If a limit of 0 is specified (not using \fI\-\-kernel\-memory\fP), the container's kernel memory is not limited. If you specify a limit, it may be rounded up to a multiple of the operating system's page size and the value can be very large, millions of trillions. .SS \fB\-\-label\fP, \fB\-l\fP=\fIkey\fP=\fIvalue\fP .PP Add metadata to a container. .SS \fB\-\-label\-file\fP=\fIfile\fP .PP Read in a line\-delimited file of labels. .SS \fB\-\-link\-local\-ip\fP=\fIip\fP .PP Not implemented. .SS \fB\-\-log\-driver\fP="\fIdriver\fP" .PP Logging driver for the container. Currently available options are \fBk8s\-file\fP, \fBjournald\fP, and \fBnone\fP, with \fBjson\-file\fP aliased to \fBk8s\-file\fP for scripting compatibility. .SS \fB\-\-log\-opt\fP=\fIname\fP=\fIvalue\fP .PP Logging driver specific options. .PP Set custom logging configuration. The following *name*s are supported: .PP \fBpath\fP: specify a path to the log file (e.g. \fB\-\-log\-opt path=/var/log/container/mycontainer.json\fP); .PP \fBmax\-size\fP: specify a max size of the log file (e.g. \fB\-\-log\-opt max\-size=10mb\fP); .PP \fBtag\fP: specify a custom log tag for the container (e.g. \fB\-\-log\-opt tag="{{.ImageName}}"\fP\&. .PP This option is currently supported only by the \fBjournald\fP log driver. .SS \fB\-\-mac\-address\fP=\fIaddress\fP .PP Container MAC address (e.g. \fB92:d0:c6:0a:29:33\fP). .PP Remember that the MAC address in an Ethernet network must be unique. The IPv6 link\-local address will be based on the device's MAC address according to RFC4862. .SS \fB\-\-memory\fP, \fB\-m\fP=\fInumber\fP[\fIunit\fP] .PP Memory limit. A \fIunit\fP can be \fBb\fP (bytes), \fBk\fP (kilobytes), \fBm\fP (megabytes), or \fBg\fP (gigabytes). .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). .SS \fB\-\-memory\-reservation\fP=\fInumber\fP[\fIunit\fP] .PP Memory soft limit. A \fIunit\fP can be \fBb\fP (bytes), \fBk\fP (kilobytes), \fBm\fP (megabytes), or \fBg\fP (gigabytes). .PP After setting memory reservation, when the system detects memory contention or low memory, containers are forced to restrict their consumption to their reservation. So you should always set the value below \fB\-\-memory\fP, otherwise the hard limit will take precedence. By default, memory reservation will be the same as memory limit. .SS \fB\-\-memory\-swap\fP=\fInumber\fP[\fIunit\fP] .PP A limit value equal to memory plus swap. A \fIunit\fP can be \fBb\fP (bytes), \fBk\fP (kilobytes), \fBm\fP (megabytes), or \fBg\fP (gigabytes). .PP Must be used with the \fB\-m\fP (\fB\-\-memory\fP) flag. The argument value should always be larger than that of \fB\-m\fP (\fB\-\-memory\fP) By default, it is set to double the value of \fB\-\-memory\fP\&. .PP Set \fInumber\fP to \fB\-1\fP to enable unlimited swap. .SS \fB\-\-memory\-swappiness\fP=\fInumber\fP .PP Tune a container's memory swappiness behavior. Accepts an integer between \fI0\fP and \fI100\fP\&. .SS \fB\-\-mount\fP=\fItype=TYPE,TYPE\-SPECIFIC\-OPTION[,...]\fP .PP Attach a filesystem mount to the container .PP Current supported mount TYPEs are \fBbind\fP, \fBvolume\fP, \fBimage\fP, \fBtmpfs\fP and \fBdevpts\fP\&. [1] \[la]#Footnote1\[ra] .PP .RS .nf e.g. type=bind,source=/path/on/host,destination=/path/in/container type=bind,src=/path/on/host,dst=/path/in/container,relabel=shared type=volume,source=vol1,destination=/path/in/container,ro=true type=tmpfs,tmpfs\-size=512M,destination=/path/in/container type=image,source=fedora,destination=/fedora\-image,rw=true type=devpts,destination=/dev/pts Common Options: · src, source: mount source spec for bind and volume. Mandatory for bind. · dst, destination, target: mount destination spec. Options specific to volume: · ro, readonly: true or false (default). Options specific to image: · rw, readwrite: true or false (default). Options specific to bind: · ro, readonly: true or false (default). · bind\-propagation: shared, slave, private, unbindable, rshared, rslave, runbindable, or rprivate(default). See also mount(2). . bind\-nonrecursive: do not setup a recursive bind mount. By default it is recursive. . relabel: shared, private. Options specific to tmpfs: · ro, readonly: true or false (default). · tmpfs\-size: Size of the tmpfs mount in bytes. Unlimited by default in Linux. · tmpfs\-mode: File mode of the tmpfs in octal. (e.g. 700 or 0700.) Defaults to 1777 in Linux. · tmpcopyup: Enable copyup from the image directory at the same location to the tmpfs. Used by default. · notmpcopyup: Disable copying files from the image to the tmpfs. .fi .RE .SS \fB\-\-name\fP=\fIname\fP .PP Assign a name to the container. .PP The operator can identify a container in three ways: .RS .IP \(bu 2 UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”); .IP \(bu 2 UUID short identifier (“f78375b1c487”); .IP \(bu 2 Name (“jonah”). .RE .PP Podman generates a UUID for each container, and if a name is not assigned to the container with \fB\-\-name\fP then it will generate a random string name. The name is useful any place you need to identify a container. This works for both background and foreground containers. .SS \fB\-\-network\fP=\fImode\fP, \fB\-\-net\fP .PP Set the network mode for the container. Invalid if using \fB\-\-dns\fP, \fB\-\-dns\-opt\fP, or \fB\-\-dns\-search\fP with \fB\-\-network\fP that is set to \fBnone\fP or \fBcontainer:\fP\fIid\fP\&. If used together with \fB\-\-pod\fP, the container will not join the pods network namespace. .PP Valid \fImode\fP values are: .RS .IP \(bu 2 \fBbridge\fP: create a network stack on the default bridge; .IP \(bu 2 \fBnone\fP: no networking; .IP \(bu 2 \fBcontainer:\fP\fIid\fP: reuse another container's network stack; .IP \(bu 2 \fBhost\fP: use the Podman 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 \fInetwork\-id\fP: connect to a user\-defined network, multiple networks should be comma separated; .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 \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: .RS .IP \(bu 2 \fBallow\_host\_loopback=true|false\fP: Allow the slirp4netns to reach the host loopback IP (\fB\fC10.0.2.2\fR). Default is false. .IP \(bu 2 \fBmtu=MTU\fP: Specify the MTU to use for this network. (Default is \fB\fC65520\fR). .IP \(bu 2 \fBcidr=CIDR\fP: Specify ip range to use for this network. (Default is \fB\fC10.0.2.0/24\fR). .IP \(bu 2 \fBenable\_ipv6=true|false\fP: Enable IPv6. Default is false. (Required for \fB\fCoutbound\_addr6\fR). .IP \(bu 2 \fBoutbound\_addr=INTERFACE\fP: Specify the outbound interface slirp should bind to (ipv4 traffic only). .IP \(bu 2 \fBoutbound\_addr=IPv4\fP: Specify the outbound ipv4 address slirp should bind to. .IP \(bu 2 \fBoutbound\_addr6=INTERFACE\fP: Specify the outbound interface slirp should bind to (ipv6 traffic only). .IP \(bu 2 \fBoutbound\_addr6=IPv6\fP: Specify the outbound ipv6 address slirp should bind to. .IP \(bu 2 \fBport\_handler=rootlesskit\fP: Use rootlesskit for port forwarding. Default. .IP \(bu 2 \fBport\_handler=slirp4netns\fP: Use the slirp4netns port forwarding. .RE .RE .SS \fB\-\-network\-alias\fP=\fIalias\fP .PP Add network\-scoped alias for the container .SS \fB\-\-no\-healthcheck\fP=\fItrue|false\fP .PP Disable any defined healthchecks for container. .SS \fB\-\-no\-hosts\fP=\fBtrue\fP|\fBfalse\fP .PP Do not create \fI/etc/hosts\fP for the container. .PP By default, Podman will manage \fI/etc/hosts\fP, adding the container's own IP address and any hosts from \fB\-\-add\-host\fP\&. .SS \fB\-\-no\-hosts\fP disables this, and the image's \fI/etc/hosts\fP will be preserved unmodified. .PP This option conflicts with \fB\-\-add\-host\fP\&. .SS \fB\-\-oom\-kill\-disable\fP=\fBtrue\fP|\fBfalse\fP .PP Whether to disable OOM Killer for the container or not. .SS \fB\-\-oom\-score\-adj\fP=\fInum\fP .PP Tune the host's OOM preferences for containers (accepts values from \fB\-1000\fP to \fB1000\fP). .SS \fB\-\-os\fP=\fIOS\fP .PP Override the OS, defaults to hosts, of the image to be pulled. For example, \fB\fCwindows\fR\&. .SS \fB\-\-pid\fP=\fImode\fP .PP Set the PID namespace mode for the container. The efault is to create a private PID namespace for the container. .RS .IP \(bu 2 \fBcontainer:\fP\fIid\fP: join another container's PID namespace; .IP \(bu 2 \fBhost\fP: use the host's PID namespace for the container. Note the host mode gives the container full access to local PID and is therefore considered insecure; .IP \(bu 2 \fBprivate\fP: create a new namespace for the container (default) .IP \(bu 2 \fBns:\fP\fIpath\fP: join the specified PID namespace. .RE .SS \fB\-\-pids\-limit\fP=\fIlimit\fP .PP Tune the container's pids limit. Set to \fB0\fP to have unlimited pids for the container. The default is \fB4096\fP on systems that support "pids" cgroup controller. .SS \fB\-\-platform\fP=\fIOS/ARCH\fP .PP Specify the platform for selecting the image. (Conflicts with \-\-arch and \-\-os) The \fB\fC\-\-platform\fR option can be used to override the current architecture and operating system. .SS \fB\-\-pod\fP=\fIname\fP .PP Run container in an existing pod. If you want Podman to make the pod for you, prefix the pod name with \fBnew:\fP\&. To make a pod with more granular options, use the \fBpodman pod create\fP command before creating a container. If a container is run with a pod, and the pod has an infra\-container, the infra\-container will be started before the container is. .SS \fB\-\-pod\-id\-file\fP=\fIpath\fP .PP Run container in an existing pod and read the pod's ID from the specified file. If a container is run within a pod, and the pod has an infra\-container, the infra\-container will be started before the container is. .SS \fB\-\-preserve\-fds\fP=\fIN\fP .PP Pass down to the process N additional file descriptors (in addition to 0, 1, 2). The total FDs will be 3+N. .SS \fB\-\-privileged\fP=\fBtrue\fP|\fBfalse\fP .PP Give extended privileges to this container. The default is \fBfalse\fP\&. .PP By default, Podman containers are unprivileged (\fB=false\fP) and cannot, for example, modify parts of the operating system. This is because by default a container is only allowed limited access to devices. A "privileged" container is given the same access to devices as the user launching the container. .PP A privileged container turns off the security features that isolate the container from the host. Dropped Capabilities, limited devices, read\-only mount points, Apparmor/SELinux separation, and Seccomp filters are all disabled. .PP Rootless containers cannot have more privileges than the account that launched them. .SS \fB\-\-publish\fP, \fB\-p\fP=\fIip\fP:\fIhostPort\fP:\fIcontainerPort\fP | \fIip\fP::\fIcontainerPort\fP | \fIhostPort\fP:\fIcontainerPort\fP | \fIcontainerPort\fP .PP Publish a container's port, or range of ports, to the host. .PP Both hostPort and containerPort can be specified as a range of ports. .PP When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. .PP If host IP is set to 0.0.0.0 or not set at all, the port will be bound on all IPs on the host. .PP Host port does not have to be specified (e.g. \fB\fCpodman run \-p 127.0.0.1::80\fR). If it is not, the container port will be randomly assigned a port on the host. .PP Use \fBpodman port\fP to see the actual mapping: \fBpodman port $CONTAINER $CONTAINERPORT\fP\&. .PP \fBNote:\fP if a container will be run within a pod, it is not necessary to publish the port for the containers in the pod. The port must only be published by the pod itself. Pod network stacks act like the network stack on the host \- you have a variety of containers in the pod, and programs in the container, all sharing a single interface and IP address, and associated ports. If one container binds to a port, no other container can use that port within the pod while it is in use. Containers in the pod can also communicate over localhost by having one container bind to localhost in the pod, and another connect to that port. .SS \fB\-\-publish\-all\fP, \fB\-P\fP=\fBtrue\fP|\fBfalse\fP .PP Publish all exposed ports to random ports on the host interfaces. The default is \fBfalse\fP\&. .PP When set to \fBtrue\fP, publish all exposed ports to the host interfaces. The default is \fBfalse\fP\&. If the operator uses \fB\-P\fP (or \fB\-p\fP) then Podman will make the exposed port accessible on the host and the ports will be available to any client that can reach the host. .PP When using this option, Podman will bind any exposed port to a random port on the host within an ephemeral port range defined by \fI/proc/sys/net/ipv4/ip\_local\_port\_range\fP\&. To find the mapping between the host ports and the exposed ports, use \fBpodman port\fP\&. .SS \fB\-\-pull\fP=\fBalways\fP|\fBmissing\fP|\fBnever\fP .PP Pull image before running. The default is \fBmissing\fP\&. .RS .IP \(bu 2 \fBmissing\fP: attempt to pull the latest image from the registries listed in registries.conf if a local image does not exist.Raise an error if the image is not in any listed registry and is not present locally. .IP \(bu 2 \fBalways\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. .IP \(bu 2 \fBnever\fP: do not pull the image from the registry, use only the local version. Raise an error if the image is not present locally. .RE .SS \fB\-\-quiet\fP, \fB\-q\fP .PP Suppress output information when pulling images .SS \fB\-\-read\-only\fP=\fBtrue\fP|\fBfalse\fP .PP Mount the container's root filesystem as read only. .PP By default a container will have its root filesystem writable allowing processes to write files anywhere. By specifying the \fB\-\-read\-only\fP flag, the container will have its root filesystem mounted as read only prohibiting any writes. .SS \fB\-\-read\-only\-tmpfs\fP=\fBtrue\fP|\fBfalse\fP .PP If container is running in \fB\-\-read\-only\fP mode, then mount a read\-write tmpfs on \fI/run\fP, \fI/tmp\fP, and \fI/var/tmp\fP\&. The default is \fBtrue\fP\&. .SS \fB\-\-replace\fP=\fBtrue\fP|\fBfalse\fP .PP If another container with the same name already exists, replace and remove it. The default is \fBfalse\fP\&. .SS \fB\-\-restart\fP=\fIpolicy\fP .PP Restart policy to follow when containers exit. Restart policy will not take effect if a container is stopped via the \fBpodman kill\fP or \fBpodman stop\fP commands. .PP Valid \fIpolicy\fP values are: .RS .IP \(bu 2 \fB\fCno\fR : Do not restart containers on exit .IP \(bu 2 \fB\fCon\-failure[:max\_retries]\fR : Restart containers when they exit with a non\-zero exit code, retrying indefinitely or until the optional \fImax\_retries\fP count is hit .IP \(bu 2 \fB\fCalways\fR : Restart containers when they exit, regardless of status, retrying indefinitely .IP \(bu 2 \fB\fCunless\-stopped\fR : Identical to \fBalways\fP .RE .PP Please note that restart will not restart containers after a system reboot. If this functionality is required in your environment, you can invoke Podman from a \fBsystemd.unit\fP(5) file, or create an init script for whichever init system is in use. To generate systemd unit files, please see \fBpodman generate systemd\fP\&. .SS \fB\-\-rm\fP=\fBtrue\fP|\fBfalse\fP .PP Automatically remove the container when it exits. The default is \fBfalse\fP\&. .SS \fB\-\-rmi\fP=\fItrue|false\fP .PP After exit of the container, remove the image unless another container is using it. The default is \fIfalse\fP\&. .SS \fB\-\-rootfs\fP .PP If specified, the first argument refers to an exploded container on the file system. .PP This is useful to run a container without requiring any image management, the rootfs of the container is assumed to be managed externally. .PP Note: On \fBSELinux\fP systems, the rootfs needs the correct label, which is by default \fBunconfined\_u:object\_r:container\_file\_t\fP\&. .SS \fB\-\-sdnotify\fP=\fBcontainer\fP|\fBconmon\fP|\fBignore\fP .PP Determines how to use the NOTIFY\_SOCKET, as passed with systemd and Type=notify. .PP Default is \fBcontainer\fP, which means allow the OCI runtime to proxy the socket into the container to receive ready notification. Podman will set the MAINPID to conmon's pid. The \fBconmon\fP option sets MAINPID to conmon's pid, and sends READY when the container has started. The socket is never passed to the runtime or the container. The \fBignore\fP option removes NOTIFY\_SOCKET from the environment for itself and child processes, for the case where some other process above Podman uses NOTIFY\_SOCKET and Podman should not use it. .SS \fB\-\-seccomp\-policy\fP=\fIpolicy\fP .PP Specify the policy to select the seccomp profile. If set to \fIimage\fP, Podman will look for a "io.podman.seccomp.profile" label in the container\-image config and use its value as a seccomp profile. Otherwise, Podman will follow the \fIdefault\fP policy by applying the default profile unless specified otherwise via \fI\-\-security\-opt seccomp\fP as described below. .PP Note that this feature is experimental and may change in the future. .SS \fB\-\-security\-opt\fP=\fIoption\fP .PP Security Options .RS .IP \(bu 2 \fBapparmor=unconfined\fP : Turn off apparmor confinement for the container .IP \(bu 2 \fBapparmor\fP=\fIyour\-profile\fP : Set the apparmor confinement profile for the container .IP \(bu 2 \fBlabel=user:\fP\fIUSER\fP: Set the label user for the container processes .IP \(bu 2 \fBlabel=role:\fP\fIROLE\fP: Set the label role for the container processes .IP \(bu 2 \fBlabel=type:\fP\fITYPE\fP: Set the label process type for the container processes .IP \(bu 2 \fBlabel=level:\fP\fILEVEL\fP: Set the label level for the container processes .IP \(bu 2 \fBlabel=filetype:\fPTYPE\_: Set the label file type for the container files .IP \(bu 2 \fBlabel=disable\fP: Turn off label separation for the container .IP \(bu 2 \fBmask\fP=\fI/path/1:/path/2\fP: The paths to mask separated by a colon. A masked path cannot be accessed inside the container. .IP \(bu 2 \fBno\-new\-privileges\fP: Disable container processes from gaining additional privileges .IP \(bu 2 \fBseccomp=unconfined\fP: Turn off seccomp confinement for the container .IP \(bu 2 \fBseccomp\fP=\fIprofile.json\fP: Allowed syscall list seccomp JSON file to be used as a seccomp filter .IP \(bu 2 \fBproc\-opts\fP=\fIOPTIONS\fP : Comma separated list of options to use for the /proc mount. More details for the possible mount options are specified at \fBproc(5)\fP man page. .IP \(bu 2 \fBunmask\fP=\fIALL\fP or \fI/path/1:/path/2\fP: Paths to unmask separated by a colon. If set to \fBALL\fP, it will unmask all the paths that are masked or made read only by default. The default masked paths are \fB/proc/acpi, /proc/kcore, /proc/keys, /proc/latency\_stats, /proc/sched\_debug, /proc/scsi, /proc/timer\_list, /proc/timer\_stats, /sys/firmware, and /sys/fs/selinux.\fP\&. The default paths that are read only are \fB/proc/asound\fP, \fB/proc/bus\fP, \fB/proc/fs\fP, \fB/proc/irq\fP, \fB/proc/sys\fP, \fB/proc/sysrq\-trigger\fP\&. .RE .PP Note: Labeling can be disabled for all containers by setting \fBlabel=false\fP in the \fBcontainers.conf\fP(5) file. .SS \fB\-\-shm\-size\fP=\fInumber\fP[\fIunit\fP] .PP Size of \fI/dev/shm\fP\&. A \fIunit\fP can be \fBb\fP (bytes), \fBk\fP (kilobytes), \fBm\fP (megabytes), or \fBg\fP (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the default is \fB64m\fP\&. When \fIsize\fP is \fB0\fP, there is no limit on the amount of memory used for IPC by the container. .SS \fB\-\-sig\-proxy\fP=\fBtrue\fP|\fBfalse\fP .PP Sets whether the signals sent to the \fBpodman run\fP command are proxied to the container process. SIGCHLD, SIGSTOP, and SIGKILL are not proxied. The default is \fBtrue\fP\&. .SS \fB\-\-stop\-signal\fP=\fIsignal\fP .PP Signal to stop a container. Default is \fBSIGTERM\fP\&. .SS \fB\-\-stop\-timeout\fP=\fIseconds\fP .PP Timeout to stop a container. Default is \fB10\fP\&. Remote connections use local containers.conf for defaults .SS \fB\-\-subgidname\fP=\fIname\fP .PP Run the container in a new user namespace using the map with \fIname\fP in the \fI/etc/subgid\fP file. If calling \fBpodman run\fP as an unprivileged user, the user needs to have the right to use the mapping. See \fBsubgid\fP(5). This flag conflicts with \fB\-\-userns\fP and \fB\-\-gidmap\fP\&. .SS \fB\-\-subuidname\fP=\fIname\fP .PP Run the container in a new user namespace using the map with \fIname\fP in the \fI/etc/subuid\fP file. If calling \fBpodman run\fP as an unprivileged user, the user needs to have the right to use the mapping. See \fBsubuid\fP(5). This flag conflicts with \fB\-\-userns\fP and \fB\-\-uidmap\fP\&. .SS \fB\-\-sysctl\fP=\fIname\fP=\fIvalue\fP .PP Configure namespaced kernel parameters at runtime. .PP For the IPC namespace, the following sysctls are allowed: .RS .IP \(bu 2 kernel.msgmax .IP \(bu 2 kernel.msgmnb .IP \(bu 2 kernel.msgmni .IP \(bu 2 kernel.sem .IP \(bu 2 kernel.shmall .IP \(bu 2 kernel.shmmax .IP \(bu 2 kernel.shmmni .IP \(bu 2 kernel.shm\_rmid\_forced .IP \(bu 2 Sysctls beginning with fs.mqueue.* .RE .PP Note: if you use the \fB\-\-ipc=host\fP option, the above sysctls will not be allowed. .PP For the network namespace, the following sysctls are allowed: .RS .IP \(bu 2 Sysctls beginning with net.* .RE .PP Note: if you use the \fB\-\-network=host\fP option, these sysctls will not be allowed. .SS \fB\-\-systemd\fP=\fBtrue\fP|\fBfalse\fP|\fBalways\fP .PP Run container in systemd mode. The default is \fBtrue\fP\&. .PP The value \fIalways\fP enforces the systemd mode is enforced without looking at the executable name. Otherwise, if set to \fBtrue\fP and the command you are running inside the container is systemd, \fI/usr/sbin/init\fP, \fI/sbin/init\fP or \fI/usr/local/sbin/init\fP\&. .PP If the command you are running inside of the container is systemd Podman will setup tmpfs mount points in the following directories: .RS .IP \(bu 2 \fI/run\fP .IP \(bu 2 \fI/run/lock\fP .IP \(bu 2 \fI/tmp\fP .IP \(bu 2 \fI/sys/fs/cgroup/systemd\fP .IP \(bu 2 \fI/var/lib/journal\fP .RE .PP It will also set the default stop signal to \fBSIGRTMIN+3\fP\&. .PP This allows systemd to run in a confined container without any modifications. .PP Note that on \fBSELinux\fP systems, systemd attempts to write to the cgroup file system. Containers writing to the cgroup file system are denied by default. The \fBcontainer\_manage\_cgroup\fP boolean must be enabled for this to be allowed on an SELinux separated system. .PP .RS .nf setsebool \-P container\_manage\_cgroup true .fi .RE .SS \fB\-\-tmpfs\fP=\fIfs\fP .PP Create a tmpfs mount. .PP Mount a temporary filesystem (\fBtmpfs\fP) mount into a container, for example: .PP .RS .nf $ podman run \-d \-\-tmpfs /tmp:rw,size=787448k,mode=1777 my\_image .fi .RE .PP This command mounts a \fBtmpfs\fP at \fI/tmp\fP within the container. The supported mount options are the same as the Linux default mount flags. If you do not specify any options, the systems uses the following options: \fBrw,noexec,nosuid,nodev\fP\&. .SS \fB\-\-tty\fP, \fB\-t\fP=\fBtrue\fP|\fBfalse\fP .PP Allocate a pseudo\-TTY. The default is \fBfalse\fP\&. .PP When set to \fBtrue\fP, Podman will allocate a pseudo\-tty and attach to the standard input of the container. This can be used, for example, to run a throwaway interactive shell. The default is \fBfalse\fP\&. .PP \fBNOTE\fP: The \-\-tty flag prevents redirection of standard output. It combines STDOUT and STDERR, it can insert control characters, and it can hang pipes. This option should only be used when run interactively in a terminal. When feeding input to Podman, use \-i only, not \-it. .PP .RS .nf echo "asdf" | podman run \-\-rm \-i someimage /bin/cat .fi .RE .SS \fB\-\-tz\fP=\fItimezone\fP .PP Set timezone in container. This flag takes area\-based timezones, GMT time, as well as \fB\fClocal\fR, which sets the timezone in the container to match the host machine. See \fB\fC/usr/share/zoneinfo/\fR for valid timezones. Remote connections use local containers.conf for defaults .SS \fB\-\-umask\fP=\fIumask\fP .PP Set the umask inside the container. Defaults to \fB\fC0022\fR\&. Remote connections use local containers.conf for defaults .SS \fB\-\-uidmap\fP=\fIcontainer\_uid\fP:\fIhost\_uid\fP:\fIamount\fP .PP Run the container in a new user namespace using the supplied mapping. This option conflicts with the \fB\-\-userns\fP and \fB\-\-subuidname\fP flags. This option can be passed several times to map different ranges. If calling \fBpodman run\fP as an unprivileged user, the user needs to have the right to use the mapping. See \fBsubuid\fP(5). .PP The following example maps uids 0\-1999 in the container to the uids 30000\-31999 on the host: \fB\-\-uidmap=0:30000:2000\fP\&. .PP \fBImportant note:\fP The new user namespace mapping based on \fB\-\-uidmap\fP is based on the initial mapping made in the \fI/etc/subuid\fP file. Assuming there is a \fI/etc/subuid\fP mapping \fBusername:100000:65536\fP, then \fBusername\fP is initially mapped to a namespace starting with uid \fB100000\fP for \fB65536\fP ids. From here the \fB\-\-uidmap\fP mapping to the new namespace starts from \fB0\fP again, but is based on the initial mapping. Meaning \fBusername\fP is initially mapped to uid \fB100000\fP which is referenced as \fB0\fP in the following \fB\-\-uidmap\fP mapping. In terms of the example above: The user \fBusername\fP is mapped to user \fB100000\fP of the initial namespace then the \fB30000\fPst id of this namespace (which is uid 130000 in this namespace) is mapped to container namespace user id \fB0\fP\&. (username \-\&> 100000 / 30000 \-\&> 0) .PP \fINote\fP: A minimal mapping has to have at least container uid \fB0\fP mapped to the parent user namespace. .SS \fB\-\-ulimit\fP=\fIoption\fP .PP Ulimit options. You can use \fBhost\fP to copy the current configuration from the host. .SS \fB\-\-user\fP, \fB\-u\fP=[\fIuser\fP | \fIuser\fP:\fIgroup\fP | \fIuid\fP | \fIuid\fP:\fIgid\fP | \fIuser\fP:\fIgid\fP | \fIuid\fP:\fIgroup\fP ] .PP Sets the username or UID used and optionally the groupname or GID for the specified command. .PP Without this argument, the command will run as the user specified in the container image. Unless overridden by a \fB\fCUSER\fR command in the Containerfile or by a value passed to this option, this user generally defaults to root. .PP When a user namespace is not in use, the UID and GID used within the container and on the host will match. When user namespaces are in use, however, the UID and GID in the container may correspond to another UID and GID on the host. In rootless containers, for example, a user namespace is always used, and root in the container will by default correspond to the UID and GID of the user invoking Podman. .SS \fB\-\-userns\fP=\fBauto\fP|\fBhost\fP|\fBkeep\-id\fP|\fBcontainer:\fP\fIid\fP|\fBns:\fP\fInamespace\fP .PP Set the user namespace mode for the container. It defaults to the \fBPODMAN\_USERNS\fP environment variable. An empty value ("") means user namespaces are disabled unless an explicit mapping is set with they \fB\fC\-\-uidmapping\fR and \fB\fC\-\-gidmapping\fR options. .RS .IP \(bu 2 \fBauto\fP: automatically create a namespace. It is possible to specify other options to \fB\fCauto\fR\&. The supported options are \fBsize=SIZE\fP to specify an explicit size for the automatic user namespace. e.g. \fB\fC\-\-userns=auto:size=8192\fR\&. If \fB\fCsize\fR is not specified, \fB\fCauto\fR will guess a size for the user namespace. \fBuidmapping=HOST\_UID:CONTAINER\_UID:SIZE\fP to force a UID mapping to be present in the user namespace. \fBgidmapping=HOST\_UID:CONTAINER\_UID:SIZE\fP to force a GID mapping to be present in the user namespace. .IP \(bu 2 \fBhost\fP: run in the user namespace of the caller. The processes running in the container will have the same privileges on the host as any other process launched by the calling user (default). .IP \(bu 2 \fBkeep\-id\fP: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container. This option is ignored for containers created by the root user. .IP \(bu 2 \fBns\fP: run the container in the given existing user namespace. .IP \(bu 2 \fBprivate\fP: create a new namespace for the container. .IP \(bu 2 \fBcontainer\fP: join the user namespace of the specified container. .RE .PP This option is incompatible with \fB\-\-gidmap\fP, \fB\-\-uidmap\fP, \fB\-\-subuidname\fP and \fB\-\-subgidname\fP\&. .SS \fB\-\-uts\fP=\fImode\fP .PP Set the UTS namespace mode for the container. The following values are supported: .RS .IP \(bu 2 \fBhost\fP: use the host's UTS namespace inside the container. .IP \(bu 2 \fBprivate\fP: create a new namespace for the container (default). .IP \(bu 2 \fBns:[path]\fP: run the container in the given existing UTS namespace. .IP \(bu 2 \fBcontainer:[container]\fP: join the UTS namespace of the specified container. .RE .SS \fB\-\-variant\fP=\fIVARIANT\fP .PP Use \fIVARIANT\fP instead of the default architecture variant of the container image. Some images can use multiple variants of the arm architectures, such as arm/v5 and arm/v7. .SS \fB\-\-volume\fP, \fB\-v\fP[=\fI[[SOURCE\-VOLUME|HOST\-DIR:]CONTAINER\-DIR[:OPTIONS]]\fP] .PP Create a bind mount. If you specify \fI/HOST\-DIR\fP:\fI/CONTAINER\-DIR\fP, Podman bind mounts \fIhost\-dir\fP in the host to \fICONTAINER\-DIR\fP in the Podman container. Similarly, \fISOURCE\-VOLUME\fP:\fI/CONTAINER\-DIR\fP will mount the volume in the host to the container. If no such named volume exists, Podman will create one. .PP The \fIoptions\fP is a comma delimited list and can be: [1] \[la]#Footnote1\[ra] .RS .IP \(bu 2 \fBrw\fP|\fBro\fP .IP \(bu 2 \fBz\fP|\fBZ\fP .IP \(bu 2 [\fBr\fP]\fBshared\fP|[\fBr\fP]\fBslave\fP|[\fBr\fP]\fBprivate\fP[\fBr\fP]\fBunbindable\fP .IP \(bu 2 [\fBr\fP]\fBbind\fP .IP \(bu 2 [\fBno\fP]\fBexec\fP .IP \(bu 2 [\fBno\fP]\fBdev\fP .IP \(bu 2 [\fBno\fP]\fBsuid\fP .IP \(bu 2 [\fBO\fP] .RE .PP The \fB\fCCONTAINER\-DIR\fR must be an absolute path such as \fB\fC/src/docs\fR\&. The volume will be mounted into the container at this directory. .PP Volumes may specify a source as well, as either a directory on the host or the name of a named volume. If no source is given, the volume will be created as an anonymously named volume with a randomly generated name, and will be removed when the container is removed via the \fB\fC\-\-rm\fR flag or \fB\fCpodman rm \-\-volumes\fR\&. .PP If a volume source is specified, it must be a path on the host or the name of a named volume. Host paths are allowed to be absolute or relative; relative paths are resolved relative to the directory Podman is run in. If the source does not exist, Podman will return an error. Users must pre\-create the source files or directories. .PP Any source that does not begin with a \fB\fC\&.\fR or \fB\fC/\fR will be treated as the name of a named volume. If a volume with that name does not exist, it will be created. Volumes created with names are not anonymous, and they are not removed by the \fB\fC\-\-rm\fR option and the \fB\fCpodman rm \-\-volumes\fR command. .PP You can specify multiple \fB\-v\fP options to mount one or more volumes into a container. .PP \fB\fCWrite Protected Volume Mounts\fR .PP You can add \fB:ro\fP or \fB:rw\fP option to mount a volume in read\-only or read\-write mode, respectively. By default, the volumes are mounted read\-write. .PP \fB\fCLabeling 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, Podman 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\fP or \fB:Z\fP to the volume mount. These suffixes tell Podman to relabel file objects on the shared volumes. The \fBz\fP option tells Podman that two containers share the volume content. As a result, Podman labels the content with a shared content label. Shared volume labels allow all containers to read/write content. The \fBZ\fP option tells Podman to label the content with a private unshared label. .PP \fB\fCOverlay Volume Mounts\fR .PP The \fB\fC:O\fR flag tells Podman to mount the directory from the host as a temporary storage using the \fB\fCoverlay file system\fR\&. The container processes can modify content within the mountpoint which is stored in the container storage in a separate directory. In overlay 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 container finishes executing, similar to a tmpfs mount point being unmounted. .PP Subsequent executions of the container will see the original source directory content, any changes from previous container executions no longer exist. .PP One use case of the overlay mount is sharing the package cache from the host into the container to allow speeding up builds. .PP Note: .PP .RS .nf \- The `O` flag conflicts with other options listed above. .fi .RE .PP Content mounted into the container is labeled with the private label. On SELinux systems, labels in the source directory must be readable by the container label. Usually containers can read/execute \fB\fCcontainer\_share\_t\fR and can read/write \fB\fCcontainer\_file\_t\fR\&. If you can not change the labels on a source volume, SELinux container separation must be disabled for the container to work. \-\& The source directory mounted into the container with an overlay mount should not be modified, it can cause unexpected failures. It is recommended that you do not modify the directory until the container finishes running. .PP Only the current container can use a private volume. .PP \fB\fCMounts propagation\fR .PP By default bind mounted volumes are \fB\fCprivate\fR\&. That means any mounts done inside container will not be visible on host and vice versa. One can change this behavior by specifying a volume mount propagation property. Making a volume shared mounts done under that volume inside container will be visible on host and vice versa. Making a volume \fBslave\fP enables only one way mount propagation and that is mounts done on host under that volume will be visible inside container but not the other way around. [1] \[la]#Footnote1\[ra] .PP To control mount propagation property of volume one can use [\fBr\fP]\fBshared\fP, [\fBr\fP]\fBslave\fP, [\fBr\fP]\fBprivate\fP or [\fBr\fP]\fBunbindable\fP propagation flag. Propagation property can be specified only for bind mounted volumes and not for internal volumes or named volumes. For mount propagation to work source mount point (mount point where source dir is mounted on) has to have right propagation properties. For shared volumes, source mount point has to be shared. And for slave volumes, source mount has to be either shared or slave. [1] \[la]#Footnote1\[ra] .PP If you want to recursively mount a volume and all of its submounts into a container, then you can use the \fBrbind\fP option. By default the bind option is used, and submounts of the source directory will not be mounted into the container. .PP Mounting the volume with the \fBnosuid\fP options means that SUID applications on the volume will not be able to change their privilege. By default volumes are mounted with \fBnosuid\fP\&. .PP Mounting the volume with the \fBnoexec\fP option means that no executables on the volume will be able to executed within the container. .PP Mounting the volume with the \fBnodev\fP option means that no devices on the volume will be able to be used by processes within the container. By default volumes are mounted with \fBnodev\fP\&. .PP If the \fIhost\-dir\fP is a mount point, then \fBdev\fP, \fBsuid\fP, and \fBexec\fP options are ignored by the kernel. .PP Use \fBdf $hostdir\fP to figure out the source mount, and then use \fBfindmnt \-o TARGET,PROPAGATION \fIsource\-mount\-dir\fP\fP to figure out propagation properties of source mount. If \fBfindmnt\fP(1) utility is not available, then one can look at mount entry for source mount point in \fI/proc/self/mountinfo\fP\&. Look at the "optional fields" and see if any propagation properties are specified. In there, \fBshared:N\fP means the mount is shared, \fBmaster:N\fP means mount is slave, and if nothing is there, the mount is private. [1] \[la]#Footnote1\[ra] .PP To change propagation properties of a mount point, use \fBmount\fP(8) command. For example, if one wants to bind mount source directory \fI/foo\fP, one can do \fBmount \-\-bind /foo /foo\fP and \fBmount \-\-make\-private \-\-make\-shared /foo\fP\&. This will convert /foo into a shared mount point. Alternatively, one can directly change propagation properties of source mount. Say, if \fI/\fP is source mount for \fI/foo\fP, then use \fBmount \-\-make\-shared /\fP to convert \fI/\fP into a shared mount. .SS \fB\-\-volumes\-from\fP[=\fICONTAINER\fP[:\fIOPTIONS\fP]] .PP Mount volumes from the specified container(s). Used to share volumes between containers. The \fIoptions\fP is a comma delimited list with the following available elements: .RS .IP \(bu 2 \fBrw\fP|\fBro\fP .IP \(bu 2 \fBz\fP .RE .PP Mounts already mounted volumes from a source container onto another container. You must supply the source's container\-id or container\-name. To share a volume, use the \-\-volumes\-from option when running the target container. You can share volumes even if the source container is not running. .PP By default, Podman mounts the volumes in the same mode (read\-write or read\-only) as it is mounted in the source container. You can change this by adding a \fB\fCro\fR or \fB\fCrw\fR \fIoption\fP\&. .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, Podman does not change the labels set by the OS. .PP To change a label in the container context, you can add \fB\fCz\fR to the volume mount. This suffix tells Podman to relabel file objects on the shared volumes. The \fB\fCz\fR option tells Podman that two containers share the volume content. As a result, Podman labels the content with a shared content label. Shared volume labels allow all containers to read/write content. .PP If the location of the volume from the source container overlaps with data residing on a target container, then the volume hides that data on the target. .SS \fB\-\-workdir\fP, \fB\-w\fP=\fIdir\fP .PP Working directory inside the container. .PP The default working directory for running binaries within a container is the root directory (\fB/\fP). The image developer can set a different default with the WORKDIR instruction. The operator can override the working directory by using the \fB\-w\fP option. .SH Exit Status .PP The exit code from \fBpodman run\fP gives information about why the container failed to run or why it exited. When \fBpodman run\fP exits with a non\-zero code, the exit codes follow the \fBchroot\fP(1) standard, see below: .PP \fB125\fP The error is with Podman itself .PP .RS .nf $ podman run \-\-foo busybox; echo $? Error: unknown flag: \-\-foo 125 .fi .RE .PP \fB126\fP The \fIcontained command\fP cannot be invoked .PP .RS .nf $ podman run busybox /etc; echo $? Error: container\_linux.go:346: starting container process caused "exec: \\"/etc\\": permission denied": OCI runtime error 126 .fi .RE .PP \fB127\fP The \fIcontained command\fP cannot be found .PP .RS .nf $ podman run busybox foo; echo $? Error: container\_linux.go:346: starting container process caused "exec: \\"foo\\": executable file not found in $PATH": OCI runtime error 127 .fi .RE .PP \fBExit code\fP \fIcontained command\fP exit code .PP .RS .nf $ podman run busybox /bin/sh \-c 'exit 3'; echo $? 3 .fi .RE .SH EXAMPLES .SS Running container in read\-only mode .PP During container image development, containers often need to write to the image content. Installing packages into \fI/usr\fP, for example. In production, applications seldom need to write to the image. Container applications write to volumes if they need to write to file systems at all. Applications can be made more secure by running them in read\-only mode using the \fB\-\-read\-only\fP switch. This protects the containers image from modification. Read only containers may still need to write temporary data. The best way to handle this is to mount tmpfs directories on \fI/run\fP and \fI/tmp\fP\&. .PP .RS .nf $ podman run \-\-read\-only \-i \-t fedora /bin/bash $ podman run \-\-read\-only \-\-read\-only\-tmpfs=false \-\-tmpfs /run \-i \-t fedora /bin/bash .fi .RE .SS Exposing log messages from the container to the host's log .PP If you want messages that are logged in your container to show up in the host's syslog/journal then you should bind mount the \fI/dev/log\fP directory as follows. .PP .RS .nf $ podman run \-v /dev/log:/dev/log \-i \-t fedora /bin/bash .fi .RE .PP From inside the container you can test this by sending a message to the log. .PP .RS .nf (bash)# logger "Hello from my container" .fi .RE .PP Then exit and check the journal. .PP .RS .nf (bash)# exit $ journalctl \-b | grep Hello .fi .RE .PP This should list the message sent to logger. .SS Attaching to one or more from STDIN, STDOUT, STDERR .PP If you do not specify \fB\-a\fP, Podman will attach everything (stdin, stdout, stderr). You can specify to which of the three standard streams (stdin, stdout, stderr) you'd like to connect instead, as in: .PP .RS .nf $ podman run \-a stdin \-a stdout \-i \-t fedora /bin/bash .fi .RE .SS Sharing IPC between containers .PP Using \fBshm\_server.c\fP available here: https://www.cs.cf.ac.uk/Dave/C/node27.html .PP Testing \fB\-\-ipc=host\fP mode: .PP Host shows a shared memory segment with 7 pids attached, happens to be from httpd: .PP .RS .nf $ sudo ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status 0x01128e25 0 root 600 1000 7 .fi .RE .PP Now run a regular container, and it correctly does NOT see the shared memory segment from the host: .PP .RS .nf $ podman run \-it shm ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status .fi .RE .PP Run a container with the new \fB\-\-ipc=host\fP option, and it now sees the shared memory segment from the host httpd: .PP .RS .nf $ podman run \-it \-\-ipc=host shm ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status 0x01128e25 0 root 600 1000 7 .fi .RE .PP Testing \fB\-\-ipc=container:\fP\fIid\fP mode: .PP Start a container with a program to create a shared memory segment: .PP .RS .nf $ podman run \-it shm bash $ sudo shm/shm\_server \& $ sudo ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status 0x0000162e 0 root 666 27 1 .fi .RE .PP Create a 2nd container correctly shows no shared memory segment from 1st container: .PP .RS .nf $ podman run shm ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status .fi .RE .PP Create a 3rd container using the \fB\-\-ipc=container:\fP\fIid\fP option, now it shows the shared memory segment from the first: .PP .RS .nf $ podman run \-it \-\-ipc=container:ed735b2264ac shm ipcs \-m $ sudo ipcs \-m \-\-\-\-\-\- Shared Memory Segments \-\-\-\-\-\-\-\- key shmid owner perms bytes nattch status 0x0000162e 0 root 666 27 1 .fi .RE .SS Mapping Ports for External Usage .PP The exposed port of an application can be mapped to a host port using the \fB\-p\fP flag. For example, an httpd port 80 can be mapped to the host port 8080 using the following: .PP .RS .nf $ podman run \-p 8080:80 \-d \-i \-t fedora/httpd .fi .RE .SS Mounting External Volumes .PP To mount a host directory as a container volume, specify the absolute path to the directory and the absolute path for the container directory separated by a colon. If the source is a named volume maintained by Podman, it is recommended to use its name rather than the path to the volume. Otherwise the volume will be considered as an orphan and wiped if you execute \fBpodman volume prune\fP: .PP .RS .nf $ podman run \-v /var/db:/data1 \-i \-t fedora bash $ podman run \-v data:/data2 \-i \-t fedora bash $ podman run \-v /var/cache/dnf:/var/cache/dnf:O \-ti fedora dnf \-y update .fi .RE .PP Using \fB\-\-mount\fP flags to mount a host directory as a container folder, specify the absolute path to the directory or the volume name, and the absolute path within the container directory: .PP .RS .nf $ podman run \-\-mount type=bind,src=/var/db,target=/data1 busybox sh $ podman run \-\-mount type=bind,src=volume\-name,target=/data1 busybox sh .fi .RE .PP When using SELinux, be aware that the host has no knowledge of container SELinux policy. Therefore, in the above example, if SELinux policy is enforced, the \fI/var/db\fP directory is not writable to the container. A "Permission Denied" message will occur and an \fBavc:\fP message in the host's syslog. .PP To work around this, at time of writing this man page, the following command needs to be run in order for the proper SELinux policy type label to be attached to the host directory: .PP .RS .nf $ chcon \-Rt svirt\_sandbox\_file\_t /var/db .fi .RE .PP Now, writing to the \fI/data1\fP volume in the container will be allowed and the changes will also be reflected on the host in \fI/var/db\fP\&. .SS Using alternative security labeling .PP You can override the default labeling scheme for each container by specifying the \fB\-\-security\-opt\fP flag. For example, you can specify the MCS/MLS level, a requirement for MLS systems. Specifying the level in the following command allows you to share the same content between containers. .PP .RS .nf podman run \-\-security\-opt label=level:s0:c100,c200 \-i \-t fedora bash .fi .RE .PP An MLS example might be: .PP .RS .nf $ podman run \-\-security\-opt label=level:TopSecret \-i \-t rhel7 bash .fi .RE .PP To disable the security labeling for this container versus running with the .SS \fB\-\-permissive\fP flag, use the following command: .PP .RS .nf $ podman run \-\-security\-opt label=disable \-i \-t fedora bash .fi .RE .PP If you want a tighter security policy on the processes within a container, you can specify an alternate type for the container. You could run a container that is only allowed to listen on Apache ports by executing the following command: .PP .RS .nf $ podman run \-\-security\-opt label=type:svirt\_apache\_t \-i \-t centos bash .fi .RE .PP Note you would have to write policy defining a \fBsvirt\_apache\_t\fP type. .PP To mask additional specific paths in the container, specify the paths separated by a colon using the \fBmask\fP option with the \fB\-\-security\-opt\fP flag. .PP .RS .nf $ podman run \-\-security\-opt mask=/foo/bar:/second/path fedora bash .fi .RE .PP To unmask all the paths that are masked by default, set the \fBunmask\fP option to \fBALL\fP\&. Or to only unmask specific paths, specify the paths as shown above with the \fBmask\fP option. .PP .RS .nf $ podman run \-\-security\-opt unmask=ALL fedora bash .fi .RE .PP .RS .nf $ podman run \-\-security\-opt unmask=/foo/bar:/sys/firmware fedora bash .fi .RE .SS Setting device weight .PP If you want to set \fI/dev/sda\fP device weight to \fB200\fP, you can specify the device weight by \fB\-\-blkio\-weight\-device\fP flag. Use the following command: .PP .RS .nf $ podman run \-it \-\-blkio\-weight\-device "/dev/sda:200" ubuntu .fi .RE .SS Using a podman container with input from a pipe .PP .RS .nf $ echo "asdf" | podman run \-\-rm \-i \-\-entrypoint /bin/cat someimage asdf .fi .RE .SS Setting Namespaced Kernel Parameters (Sysctls) .PP The \fB\-\-sysctl\fP sets namespaced kernel parameters (sysctls) in the container. For example, to turn on IP forwarding in the containers network namespace, run this command: .PP .RS .nf $ podman run \-\-sysctl net.ipv4.ip\_forward=1 someimage .fi .RE .PP Note that not all sysctls are namespaced. Podman does not support changing sysctls inside of a container that also modify the host system. As the kernel evolves we expect to see more sysctls become namespaced. .PP See the definition of the \fB\-\-sysctl\fP option above for the current list of supported sysctls. .SS Set UID/GID mapping in a new user namespace .PP Running a container in a new user namespace requires a mapping of the uids and gids from the host. .PP .RS .nf $ podman run \-\-uidmap 0:30000:7000 \-\-gidmap 0:30000:7000 fedora echo hello .fi .RE .SS Configuring Storage Options from the command line .PP Podman allows for the configuration of storage by changing the values in the \fI/etc/container/storage.conf\fP or by using global options. This shows how to setup and use fuse\-overlayfs for a one time run of busybox using global options. .PP .RS .nf podman \-\-log\-level=debug \-\-storage\-driver overlay \-\-storage\-opt "overlay.mount\_program=/usr/bin/fuse\-overlayfs" run busybox /bin/sh .fi .RE .SS Configure timezone in a container .PP .RS .nf $ podman run \-\-tz=local alpine date $ podman run \-\-tz=Asia/Shanghai alpine date $ podman run \-\-tz=US/Eastern alpine date .fi .RE .SS Rootless Containers .PP Podman runs as a non root user on most systems. This feature requires that a new enough version of \fBshadow\-utils\fP be installed. The \fBshadow\-utils\fP package must include the \fBnewuidmap\fP(1) and \fBnewgidmap\fP(1) executables. .PP Note: RHEL7 and Centos 7 will not have this feature until RHEL7.7 is released. .PP In order for users to run rootless, there must be an entry for their username in \fI/etc/subuid\fP and \fI/etc/subgid\fP which lists the UIDs for their user namespace. .PP Rootless Podman works better if the fuse\-overlayfs and slirp4netns packages are installed. The \fBfuse\-overlay\fP package provides a userspace overlay storage driver, otherwise users need to use the \fBvfs\fP storage driver, which is diskspace expensive and does not perform well. slirp4netns is required for VPN, without it containers need to be run with the \fB\-\-network=host\fP flag. .SH ENVIRONMENT .PP Environment variables within containers can be set using multiple different options, in the following order of precedence (later entries override earlier entries): .RS .IP \(bu 2 Container image: Any environment variables specified in the container image. .IP \(bu 2 \fB\-\-http\-proxy\fP: By default, several environment variables will be passed in from the host, such as \fBhttp\_proxy\fP and \fBno\_proxy\fP\&. See \fB\-\-http\-proxy\fP for details. .IP \(bu 2 \fB\-\-env\-host\fP: Host environment of the process executing Podman is added. .IP \(bu 2 \fB\-\-env\-file\fP: Any environment variables specified via env\-files. If multiple files specified, then they override each other in order of entry. .IP \(bu 2 \fB\-\-env\fP: Any environment variables specified will override previous settings. .RE .PP Run containers and set the environment ending with a \fB*\fP and a \fB*****\fP: .PP .RS .nf $ export ENV1=a $ podman run \-\-env ENV* alpine printenv ENV1 a $ podman run \-\-env ENV*****=b alpine printenv ENV***** b .fi .RE .SH FILES .PP \fB/etc/subuid\fP .PP \fB/etc/subgid\fP .PP NOTE: Use the environment variable \fB\fCTMPDIR\fR to change the temporary storage location of downloaded container images. Podman defaults to use \fB\fC/var/tmp\fR\&. .SH SEE ALSO .PP \fBpodman\fP(1), \fBpodman\-save\fP(1), \fBpodman\-ps\fP(1), \fBpodman\-attach\fP(1), \fBpodman\-pod\-create\fP(1), \fBpodman\-port\fP(1), \fBpodman\-kill\fP(1), \fBpodman\-stop\fP(1), \fBpodman\-generate\-systemd\fP(1) \fBpodman\-rm\fP(1), \fBsubgid\fP(5), \fBsubuid\fP(5), \fBcontainers.conf\fP(5), \fBsystemd.unit\fP(5), \fBsetsebool\fP(8), \fBslirp4netns\fP(1), \fBfuse\-overlayfs\fP(1), \fBproc\fP(5)**. .SH HISTORY .PP September 2018, updated by Kunal Kushwaha .PP October 2017, converted from Docker documentation to Podman by Dan Walsh for Podman dwalsh@redhat.com \[la]mailto:dwalsh@redhat.com\[ra] .PP November 2015, updated by Sally O'Malley somalley@redhat.com \[la]mailto:somalley@redhat.com\[ra] .PP June 2014, updated by Sven Dowideit SvenDowideit@home.org.au \[la]mailto:SvenDowideit@home.org.au\[ra] .PP April 2014, Originally compiled by William Henry whenry@redhat.com \[la]mailto:whenry@redhat.com\[ra] based on docker.com source material and internal work. .SH FOOTNOTES .PP 1: The Podman project is committed to inclusivity, a core value of open source. The \fB\fCmaster\fR and \fB\fCslave\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, Podman will follow suit immediately.