.nh .TH podman\-create(1) .SH NAME .PP podman\-create \- Create a new container .SH SYNOPSIS .PP \fBpodman create\fP [\fIoptions\fP] \fIimage\fP [\fIcommand\fP [\fIarg\fP ...]] .PP \fBpodman container create\fP [\fIoptions\fP] \fIimage\fP [\fIcommand\fP [\fIarg\fP ...]] .SH DESCRIPTION .PP Creates a writable container layer over the specified image and prepares it for running the specified command. The container ID is then printed to STDOUT. This is similar to \fBpodman run \-d\fP except the container is never started. You can then use the \fBpodman start\fP \fIcontainer\fP command to start the container at any point. .PP The initial status of the container created with \fBpodman create\fP is 'created'. .PP Default settings for flags are defined in \fB\fCcontainers.conf\fR\&. Most settings for remote connections use the server's 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 create 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 create 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 create 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 create 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 create oci\-archive:/tmp/fedora echo hello .fi .RE .SH OPTIONS .SS \fB\-\-add\-host\fP=\fIhost\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. .SS \fB\-\-annotation\fP=\fIkey=value\fP .PP Add an annotation to the container. The format is key=value. The \fB\-\-annotation\fP 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=\fIlocation\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 standard 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 stdin, stdout, and stderr. .SS \fB\-\-authfile\fP=\fIpath\fP .PP Path of the authentication file. Default is ${XDG\_RUNTIME\_DIR}/containers/auth.json .PP Note: You can also override the default path of the authentication file by setting the REGISTRY\_AUTH\_FILE environment variable. \fB\fCexport REGISTRY\_AUTH\_FILE=path\fR .SS \fB\-\-blkio\-weight\fP=\fIweight\fP .PP Block IO weight (relative weight) accepts a weight value between 10 and 1000. .SS \fB\-\-blkio\-weight\-device\fP=\fIweight\fP .PP Block IO weight (relative device weight, format: \fB\fCDEVICE\_NAME:WEIGHT\fR). .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. \fBhost\fP: use the host's cgroup namespace inside the container. \fBcontainer:\fP: join the namespace of the specified container. \fBns:\fP: join the namespace at the specified path. \fBprivate\fP: create a new cgroup namespace. .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=\fImode\fP .PP Determines whether the container will create CGroups. Valid values are \fIenabled\fP, \fIdisabled\fP, \fIno\-conmon\fP, \fIsplit\fP, which the default being \fIenabled\fP\&. .PP The \fIenabled\fP option will create a new cgroup under the cgroup\-parent. The \fIdisabled\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 \fIno\-conmon\fP option disables a new CGroup only for the conmon process. The \fIsplit\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 \fI\-\-cgroup\-parent\fP with \fIsplit\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=\fIid\fP .PP Write the container ID to the file .SS \fB\-\-conmon\-pidfile\fP=\fIpath\fP .PP Write the pid of the \fB\fCconmon\fR process to a file. \fB\fCconmon\fR runs in a separate process than Podman, so 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 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: .PP PID container CPU CPU share 100 {C0} 0 100% of CPU0 101 {C1} 1 100% of CPU1 102 {C1} 2 100% of CPU2 .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=\fIcpus\fP .PP CPUs in which to allow execution (0\-3, 0,1) .SS \fB\-\-cpuset\-mems\fP=\fInodes\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\fC\-\-cpuset\-mems=0,1\fR then processes in your container will only use memory from the first two memory nodes. .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="type major:minor mode" .PP Add a rule to the cgroup allowed devices list. The rule is expected to be in the format specified in the Linux kernel documentation (Documentation/cgroup\-v1/devices.txt): \- type: a (all), c (char), or b (block); \- major and minor: either a number, or * for all; \- mode: a composition of r (read), w (write), and m (mknod(2)). .SS \fB\-\-device\-read\-bps\fP=\fIpath\fP .PP Limit read rate (bytes per second) from a device (e.g. \-\-device\-read\-bps=/dev/sda:1mb) .SS \fB\-\-device\-read\-iops\fP=\fIpath\fP .PP Limit read rate (IO per second) from a device (e.g. \-\-device\-read\-iops=/dev/sda:1000) .SS \fB\-\-device\-write\-bps\fP=\fIpath\fP .PP Limit write rate (bytes per second) to a device (e.g. \-\-device\-write\-bps=/dev/sda:1mb) .SS \fB\-\-device\-write\-iops\fP=\fIpath\fP .PP Limit write rate (IO per second) to a device (e.g. \-\-device\-write\-iops=/dev/sda:1000) .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=\fIdns\fP .PP Set custom DNS servers. Invalid if using \fB\-\-dns\fP and \fB\-\-network\fP that is set to 'none' or 'container:\&'. .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\fP flags is necessary for every run. .PP The special value \fBnone\fP can be specified to disable creation of \fB/etc/resolv.conf\fP in the container by Podman. The \fB/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 and \fB\-\-network\fP that is set to 'none' or 'container:\&'. .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 'none' or 'container:\&'. (Use \-\&\-\&dns\-\&search=. 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. 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=\fItrue|false\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. \-\-expose=3300\-3310) to set up port redirection on the host system. .SS \fB\-\-gidmap\fP=\fIcontainer\_gid:host\_gid:amount\fP .PP GID map for the user namespace. Using this flag will run the container with user namespace enabled. It conflicts with the \fB\fC\-\-userns\fR and \fB\fC\-\-subgidname\fR flags. .PP The following example maps uids 0\-2000 in the container to the uids 30000\-31999 on the host and gids 0\-2000 in the container to the gids 30000\-31999 on the host. \fB\fC\-\-gidmap=0:30000:2000\fR .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 \fB\fCnone\fR 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\fC/bin/sh \-c\fR\&. .SS \fB\-\-health\-interval\fP=\fIinterval\fP .PP Set an interval for the healthchecks (a value of \fB\fCdisable\fR results in no automatic timer setup) (default "30s") .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 \fB\fC3\fR\&. .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 \fB\fC2m3s\fR\&. The default value is \fB\fC0s\fR .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 \fB\fC1m22s\fR\&. The default value is \fB\fC30s\fR\&. .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\-\-help\fP .PP Print usage statement .SS \fB\-\-http\-proxy\fP=\fItrue|false\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 \fB\fC\-\-http\-proxy\fR option to \fB\fCfalse\fR\&. The environment variables passed in include \fB\fChttp\_proxy\fR, \fB\fChttps\_proxy\fR, \fB\fCftp\_proxy\fR, \fB\fCno\_proxy\fR, 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\fC\-\-env\fR flag, or hard coding the proxy environment at container build time.) (Not available for remote commands) .PP For example, to disable passing these environment variables from host to container: .PP \fB\fC\-\-http\-proxy=false\fR .PP Defaults to \fB\fCtrue\fR .SS \fB\-\-image\-volume\fP, \fBbuiltin\-volume\fP=\fIbind|tmpfs|ignore\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=\fItrue|false\fP .PP Keep STDIN open even if not attached. The default is \fIfalse\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=\fIipc\fP .PP Default is to create a private IPC namespace (POSIX SysV IPC) for the container 'container:\&': reuses another container shared memory, semaphores and message queues 'host': 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. 'ns:\&' path to an IPC namespace to join. .SS \fB\-\-kernel\-memory\fP=\fInumber[unit]\fP .PP Kernel memory limit (format: \fB\fC[]\fR, where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes)) .PP Constrains the kernel memory available to a container. If a limit of 0 is specified (not using \fB\fC\-\-kernel\-memory\fR), 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=\fIlabel\fP .PP Add metadata to a container (e.g., \-\-label com.example.key=value) .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="\fIk8s\-file\fP" .PP Logging driver for the container. Currently available options are \fIk8s\-file\fP, \fIjournald\fP, and \fInone\fP, with \fIjson\-file\fP aliased to \fIk8s\-file\fP for scripting compatibility. .SS \fB\-\-log\-opt\fP=\fIname\fP=\fIvalue\fP .PP Set custom logging configuration. The following *name*s are supported: .RS .IP \(bu 2 \fBpath\fP: specify a path to the log file (e.g. \fB\-\-log\-opt path=/var/log/container/mycontainer.json\fP); .IP \(bu 2 \fBmax\-size\fP: specify a max size of the log file (e.g. \fB\-\-log\-opt max\-size=10mb\fP); .IP \(bu 2 \fBtag\fP: specify a custom log tag for the container (e.g. \fB\-\-log\-opt tag="{{.ImageName}}"\fP\&. .RE .PP It supports the same keys as \fBpodman inspect \-\-format\fP\&. .PP This option is currently supported only by the \fBjournald\fP log driver. .PP \fB\fC\-\-log\-opt tag="{{.ImageName}}"\fR .PP It supports the same keys as \fB\fCpodman inspect \-\-format\fR\&. .PP It is currently supported only by the journald log driver. .SS \fB\-\-mac\-address\fP=\fIaddress\fP .PP Container MAC address (e.g. 92:d0:c6:0a:29:33) .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=\fIlimit\fP .PP Memory limit (format: [], where unit = b (bytes), k (kilobytes), m (megabytes), or g (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=\fIlimit\fP .PP Memory soft limit (format: [], where unit = b (bytes), k (kilobytes), m (megabytes), or g (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=\fIlimit\fP .PP A limit value equal to memory plus swap. Must be used with the \fB\-m\fP (\fB\-\-memory\fP) flag. The swap \fB\fCLIMIT\fR should always be larger than \fB\-m\fP (\fB\-\-memory\fP) value. By default, the swap \fB\fCLIMIT\fR will be set to double the value of \-\-memory. .PP The format of \fB\fCLIMIT\fR is \fB\fC[]\fR\&. Unit can be \fB\fCb\fR (bytes), \fB\fCk\fR (kilobytes), \fB\fCm\fR (megabytes), or \fB\fCg\fR (gigabytes). If you don't specify a unit, \fB\fCb\fR is used. Set LIMIT to \fB\fC\-1\fR to enable unlimited swap. .SS \fB\-\-memory\-swappiness\fP=\fInumber\fP .PP Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. .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: UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”) UUID short identifier (“f78375b1c487”) Name (“jonah”) .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 pod's 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=\fItrue|false\fP .PP Do not create /etc/hosts for the container. By default, Podman will manage /etc/hosts, 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 \fB/etc/host\fP will be preserved unmodified. .PP This option conflicts with \fB\-\-add\-host\fP\&. .SS \fB\-\-oom\-kill\-disable\fP=\fItrue|false\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 \-1000 to 1000) .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=\fIpid\fP .PP Set the PID mode for the container Default is to create a private PID namespace for the container \- \fB\fCcontainer:\fR: join another container's PID namespace \- \fB\fChost\fR: 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. \- \fB\fCns\fR: join the specified PID namespace \- \fB\fCprivate\fR: create a new namespace for the container (default) .SS \fB\-\-pids\-limit\fP=\fIlimit\fP .PP Tune the container's pids limit. Set \fB\fC0\fR to have unlimited pids for the container. (default "4096" on systems that support PIDS cgroups). .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, preference the pod name with \fB\fCnew:\fR\&. To make a pod with more granular options, use the \fB\fCpodman pod create\fR command before creating a container. .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\-\-privileged\fP=\fItrue|false\fP .PP Give extended privileges to this container. The default is \fIfalse\fP\&. .PP By default, Podman containers are “unprivileged” (=false) and cannot, for example, modify parts of the operating system. This is because by default a container is not allowed to access any devices. A “privileged” container is given access to all devices. .PP When the operator executes a privileged container, Podman enables access to all devices on the host, turns off graphdriver mount options, as well as turning off most of the security measures protecting the host from the container. .PP Rootless containers cannot have more privileges than the account that launched them. .SS \fB\-\-publish\fP, \fB\-p\fP=\fIport\fP .PP Publish a container's port, or range of ports, to the host .PP Format: \fB\fCip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort\fR Both hostPort and containerPort can be specified as a range of ports. When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., \fB\fCpodman run \-p 1234\-1236:1222\-1224 \-\-name thisWorks \-t busybox\fR but not \fB\fCpodman run \-p 1230\-1236:1230\-1240 \-\-name RangeContainerPortsBiggerThanRangeHostPorts \-t busybox\fR) With host IP: \fB\fCpodman run \-p 127.0.0.1:$HOSTPORT:$CONTAINERPORT \-\-name CONTAINER \-t someimage\fR 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. 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. Use \fB\fCpodman port\fR to see the actual mapping: \fB\fCpodman port CONTAINER $CONTAINERPORT\fR .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=\fItrue|false\fP .PP Publish all exposed ports to random ports on the host interfaces. The default is \fIfalse\fP\&. .PP When set to true publish all exposed ports to the host interfaces. The default is false. If the operator uses \-P (or \-p) 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. When using \-P, Podman will bind any exposed port to a random port on the host within an \fIephemeral port range\fP defined by \fB\fC/proc/sys/net/ipv4/ip\_local\_port\_range\fR\&. To find the mapping between the host ports and the exposed ports, use \fB\fCpodman port\fR\&. .SS \fB\-\-pull\fP=\fImissing\fP .PP Pull image before creating ("always"|"missing"|"never") (default "missing"). 'missing': default value, 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. 'always': 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. 'never': 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 \fImissing\fP\&. .SS \fB\-\-quiet\fP, \fB\-q\fP .PP Suppress output information when pulling images .SS \fB\-\-read\-only\fP=\fItrue|false\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\fC\-\-read\-only\fR flag the container will have its root filesystem mounted as read only prohibiting any writes. .SS \fB\-\-read\-only\-tmpfs\fP=\fItrue|false\fP .PP If container is running in \-\-read\-only mode, then mount a read\-write tmpfs on /run, /tmp, and /var/tmp. The default is \fItrue\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 \fB\fCpodman kill\fR or \fB\fCpodman stop\fR commands. .PP Valid 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\-0 exit code, retrying indefinitely or until the optional max\_retries 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 systemd unit file, or create an init script for whichever init system is in use. To generate systemd unit files, please see \fIpodman generate systemd\fP .SS \fB\-\-rm\fP=\fItrue|false\fP .PP Automatically remove the container when it exits. 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. .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 \fB\fCapparmor=unconfined\fR : Turn off apparmor confinement for the container .IP \(bu 2 \fB\fCapparmor=your\-profile\fR : Set the apparmor confinement profile for the container .IP \(bu 2 \fB\fClabel=user:USER\fR : Set the label user for the container processes .IP \(bu 2 \fB\fClabel=role:ROLE\fR : Set the label role for the container processes .IP \(bu 2 \fB\fClabel=type:TYPE\fR : Set the label process type for the container processes .IP \(bu 2 \fB\fClabel=level:LEVEL\fR : Set the label level for the container processes .IP \(bu 2 \fB\fClabel=filetype:TYPE\fR : Set the label file type for the container files .IP \(bu 2 \fB\fClabel=disable\fR : Turn off label separation for the container .IP \(bu 2 \fB\fCmask=/path/1:/path/2\fR : The paths to mask separated by a colon. A masked path cannot be accessed inside the container. .IP \(bu 2 \fB\fCno\-new\-privileges\fR : Disable container processes from gaining additional privileges .IP \(bu 2 \fB\fCseccomp=unconfined\fR : Turn off seccomp confinement for the container .IP \(bu 2 \fB\fCseccomp=profile.json\fR : White listed syscalls seccomp Json file to be used as a seccomp filter .IP \(bu 2 \fB\fCunmask=ALL or /path/1:/path/2\fR : 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, /proc/bus, /proc/fs, /proc/irq, /proc/sys, /proc/sysrq\-trigger\fP\&. .IP \(bu 2 \fB\fCproc\-opts=OPTIONS\fR : 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. .RE .PP Note: Labeling can be disabled for all containers by setting label=false in the \fBcontainers.conf\fP (\fB\fC/etc/containers/containers.conf\fR or \fB\fC$HOME/.config/containers/containers.conf\fR) file. .SS \fB\-\-shm\-size\fP=\fIsize\fP .PP Size of \fB\fC/dev/shm\fR (format: [], where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes)) If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses \fB\fC64m\fR\&. When size is \fB\fC0\fR, there is no limit on the amount of memory used for IPC by the container. .SS \fB\-\-stop\-signal\fP=\fISIGTERM\fP .PP Signal to stop a container. Default is SIGTERM. .SS \fB\-\-stop\-timeout\fP=\fIseconds\fP .PP Timeout (in seconds) to stop a container. Default is 10. Remote connections use local containers.conf for defaults .SS \fB\-\-subgidname\fP=\fIname\fP .PP Name for GID map from the \fB\fC/etc/subgid\fR file. Using this flag will run the container with user namespace enabled. This flag conflicts with \fB\fC\-\-userns\fR and \fB\fC\-\-gidmap\fR\&. .SS \fB\-\-subuidname\fP=\fIname\fP .PP Name for UID map from the \fB\fC/etc/subuid\fR file. Using this flag will run the container with user namespace enabled. This flag conflicts with \fB\fC\-\-userns\fR and \fB\fC\-\-uidmap\fR\&. .SS \fB\-\-sysctl\fP=\fISYSCTL\fP .PP Configure namespaced kernel parameters at runtime .PP IPC Namespace \- current sysctls allowed: .PP kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, kernel.shmmax, kernel.shmmni, kernel.shm\_rmid\_forced Sysctls beginning with fs.mqueue.* .PP Note: if you use the \-\-ipc=host option these sysctls will not be allowed. .PP Network Namespace \- current sysctls allowed: Sysctls beginning with net.* .PP Note: if you use the \-\-network=host option these sysctls will not be allowed. .SS \fB\-\-systemd\fP=\fItrue|false|always\fP .PP Run container in systemd mode. The default is \fItrue\fP\&. .PP The value \fIalways\fP enforces the systemd mode is enforced without looking at the executable name. Otherwise, if set to true and the command you are running inside the container is systemd, /usr/sbin/init, /sbin/init or /usr/local/sbin/init. .PP If the command you are running inside of the container is systemd, Podman will setup tmpfs mount points in the following directories: .PP /run, /run/lock, /tmp, /sys/fs/cgroup/systemd, /var/lib/journal .PP It will also set the default stop signal to SIGRTMIN+3. .PP This allow systemd to run in a confined container without any modifications. .PP Note: On \fB\fCSELinux\fR systems, systemd attempts to write to the cgroup file system. Containers writing to the cgroup file system are denied by default. The \fB\fCcontainer\_manage\_cgroup\fR boolean must be enabled for this to be allowed on an SELinux separated system. .PP \fB\fCsetsebool \-P container\_manage\_cgroup true\fR .SS \fB\-\-tmpfs\fP=\fIfs\fP .PP Create a tmpfs mount .PP Mount a temporary filesystem (\fB\fCtmpfs\fR) mount into a container, for example: .PP $ podman create \-d \-\-tmpfs /tmp:rw,size=787448k,mode=1777 my\_image .PP This command mounts a \fB\fCtmpfs\fR at \fB\fC/tmp\fR within the container. The supported mount options are the same as the Linux default \fB\fCmount\fR flags. If you do not specify any options, the systems uses the following options: \fB\fCrw,noexec,nosuid,nodev\fR\&. .SS \fB\-\-tty\fP, \fB\-t\fP=\fItrue|false\fP .PP Allocate a pseudo\-TTY. The default is \fIfalse\fP\&. .PP When set to true 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 false. .PP Note: The \fB\-t\fP option is incompatible with a redirection of the Podman client standard input. .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:host\_uid:amount\fP .PP UID map for the user namespace. Using this flag will run the container with user namespace enabled. It conflicts with the \fB\fC\-\-userns\fR and \fB\fC\-\-subuidname\fR flags. .PP The following example maps uids 0\-2000 in the container to the uids 30000\-31999 on the host and gids 0\-2000 in the container to the gids 30000\-31999 on the host. \fB\fC\-\-uidmap=0:30000:2000\fR .SS \fB\-\-ulimit\fP=\fIoption\fP .PP Ulimit options .PP You can pass \fB\fChost\fR to copy the current configuration from the host. .SS \fB\-\-user\fP, \fB\-u\fP=\fIuser\fP .PP Sets the username or UID used and optionally the groupname or GID for the specified command. .PP The following examples are all valid: \-\-user [user | user:group | uid | uid:gid | user:gid | uid:group ] .PP Without this argument the command will be run as root in the container. .SS \fB\-\-userns\fP=\fIauto\fP[:OPTIONS] .SS \fB\-\-userns\fP=\fIhost\fP .SS \fB\-\-userns\fP=\fIkeep\-id\fP .SS \fB\-\-userns\fP=container:container .SS \fB\-\-userns\fP=private .SS \fB\-\-userns\fP=\fIns:my\_namespace\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. .RS .IP \(bu 2 \fB\fCauto\fR: 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 \fB\fCcontainer\fR: join the user namespace of the specified container. .IP \(bu 2 \fB\fChost\fR: run in the user namespace of the caller. This is the default if no user namespace options are set. The processes running in the container will have the same privileges on the host as any other process launched by the calling user. .IP \(bu 2 \fB\fCkeep\-id\fR: 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 \fB\fCns\fR: run the container in the given existing user namespace. .IP \(bu 2 \fB\fCprivate\fR: create a new namespace for the container (default) .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, \fB\fC\-v /HOST\-DIR:/CONTAINER\-DIR\fR, Podman bind mounts \fB\fC/HOST\-DIR\fR in the host to \fB\fC/CONTAINER\-DIR\fR in the Podman container. Similarly, \fB\fC\-v SOURCE\-VOLUME:/CONTAINER\-DIR\fR will mount the volume in the host to the container. If no such named volume exists, Podman will create one. The \fB\fCOPTIONS\fR are a comma delimited list and can be: [1] \[la]#Footnote1\[ra] .PP The \fIoptions\fP is a comma delimited list and can be: .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\fC:ro\fR or \fB\fC: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 \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\fC:z\fR or \fB\fC:Z\fR to the volume mount. These suffixes tell 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. The \fB\fCZ\fR option tells Podman to label the content with a private unshared label. Only the current container can use a private volume. .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 \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 \fB\fCshared\fR mounts done under that volume inside container will be visible on host and vice versa. Making a volume \fB\fCslave\fR 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 a volume one can use the [\fBr\fP]\fBshared\fP, [\fBr\fP]\fBslave\fP, [\fBr\fP]\fBprivate\fP or the [\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 the source mount point (the mount point where source dir is mounted on) 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 point 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 \fB\fCrbind\fR 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 \fB\fCnosuid\fR options means that SUID applications on the volume will not be able to change their privilege. By default volumes are mounted with \fB\fCnosuid\fR\&. .PP Mounting the volume with the noexec option means that no executables on the volume will be able to executed within the container. .PP Mounting the volume with the nodev 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 \fB\fCnodev\fR\&. .PP If the is a mount point, then "dev", "suid", and "exec" options are ignored by the kernel. .PP Use \fB\fCdf \fR to figure out the source mount and then use \fB\fCfindmnt \-o TARGET,PROPAGATION \fR to figure out propagation properties of source mount. If \fB\fCfindmnt\fR utility is not available, then one can look at mount entry for source mount point in \fB\fC/proc/self/mountinfo\fR\&. Look at \fB\fCoptional fields\fR and see if any propagation properties are specified. \fB\fCshared:X\fR means mount is \fB\fCshared\fR, \fB\fCmaster:X\fR means mount is \fB\fCslave\fR and if nothing is there that means mount is \fB\fCprivate\fR\&. [1] \[la]#Footnote1\[ra] .PP To change propagation properties of a mount point use \fB\fCmount\fR command. For example, if one wants to bind mount source directory \fB\fC/foo\fR one can do \fB\fCmount \-\-bind /foo /foo\fR and \fB\fCmount \-\-make\-private \-\-make\-shared /foo\fR\&. This will convert /foo into a \fB\fCshared\fR mount point. Alternatively one can directly change propagation properties of source mount. Say \fB\fC/\fR is source mount for \fB\fC/foo\fR, then use \fB\fCmount \-\-make\-shared /\fR to convert \fB\fC/\fR into a \fB\fCshared\fR 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 (/). 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 EXAMPLES .SS Create a container using a local image .PP .RS .nf $ podman create alpine ls .fi .RE .SS Create a container using a local image and annotate it .PP .RS .nf $ podman create \-\-annotation HELLO=WORLD alpine ls .fi .RE .SS Create a container using a local image, allocating a pseudo\-TTY, keeping stdin open and name it myctr .PP .RS .nf podman create \-t \-i \-\-name myctr alpine ls .fi .RE .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 create \-\-uidmap 0:30000:7000 \-\-gidmap 0:30000:7000 fedora echo hello .fi .RE .SS Configure timezone in a container .PP .RS .nf $ podman create \-\-tz=local alpine date $ podman create \-\-tz=Asia/Shanghai alpine date $ podman create \-\-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 shadow\-utils be installed. The shadow\-utils package must include the newuidmap and newgidmap 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 /etc/subuid and /etc/subgid which lists the UIDs for their user namespace. .PP Rootless Podman works better if the fuse\-overlayfs and slirp4netns packages are installed. The fuse\-overlay package provides a userspace overlay storage driver, otherwise users need to use the vfs 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 \-\-network=host flag. .SH ENVIRONMENT .PP Environment variables within containers can be set using multiple different options: This section describes the precedence. .PP Precedence order (later entries override earlier entries): .RS .IP \(bu 2 \fB\-\-env\-host\fP : Host environment of the process executing Podman is added. .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 Container image : Any environment variables specified in the container image. .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 Create containers and set the environment ending with a \fB*\fP and a ***** .PP .RS .nf $ export ENV1=a $ podman create \-\-name ctr \-\-env ENV* alpine printenv ENV1 $ podman start \-\-attach ctr a $ podman create \-\-name ctr \-\-env ENV*****=b alpine printenv ENV***** $ podman start \-\-attach ctr b .fi .RE .SH FILES .PP \fB/etc/subuid\fP \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 October 2017, converted from Docker documentation to Podman by Dan Walsh for Podman dwalsh@redhat.com \[la]mailto:dwalsh@redhat.com\[ra] .PP November 2014, updated by Sven Dowideit SvenDowideit@home.org.au \[la]mailto:SvenDowideit@home.org.au\[ra] .PP September 2014, updated by Sven Dowideit SvenDowideit@home.org.au \[la]mailto:SvenDowideit@home.org.au\[ra] .PP August 2014, updated by Sven Dowideit SvenDowideit@home.org.au \[la]mailto:SvenDowideit@home.org.au\[ra] .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.