github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-pod-create.1.md.in (about)

     1  % podman-pod-create 1
     2  
     3  ## NAME
     4  podman\-pod\-create - Create a new pod
     5  
     6  ## SYNOPSIS
     7  **podman pod create** [*options*] [*name*]
     8  
     9  ## DESCRIPTION
    10  
    11  Creates an empty pod, or unit of multiple containers, and prepares it to have
    12  containers added to it. The pod can be created with a specific name. If a name
    13  is not given a random name is generated. The pod ID is printed to STDOUT. You
    14  can then use **podman create --pod `<pod_id|pod_name>` ...** to add containers
    15  to the pod, and **podman pod start `<pod_id|pod_name>`** to start the pod.
    16  
    17  The operator can identify a pod in three ways:
    18  UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)
    19  UUID short identifier (“f78375b1c487”)
    20  Name (“jonah”)
    21  
    22  podman generates a UUID for each pod, and if a name is not assigned
    23  to the container with **--name** then a random string name is generated
    24  for it. This name is useful to identify a pod.
    25  
    26  Note: resource limit related flags work by setting the limits explicitly in the pod's cgroup parent
    27  for all containers joining the pod. A container can override the resource limits when joining a pod.
    28  For example, if a pod was created via **podman pod create --cpus=5**, specifying **podman container create --pod=`<pod_id|pod_name>` --cpus=4** causes the container to use the smaller limit. Also, containers which specify their own cgroup, such as **--cgroupns=host**, do NOT get the assigned pod level cgroup resources.
    29  
    30  ## OPTIONS
    31  
    32  @@option add-host
    33  
    34  The /etc/hosts file is shared between all containers in the pod.
    35  
    36  @@option blkio-weight
    37  
    38  @@option blkio-weight-device
    39  
    40  @@option cgroup-parent
    41  
    42  @@option cpu-shares
    43  
    44  #### **--cpus**=*amount*
    45  
    46  Set the total number of CPUs delegated to the pod. Default is 0.000 which indicates that there is no limit on computation power.
    47  
    48  @@option cpuset-cpus
    49  
    50  @@option cpuset-mems
    51  
    52  @@option device
    53  
    54  Note: the pod implements devices by storing the initial configuration passed by the user and recreating the device on each container added to the pod.
    55  
    56  @@option device-read-bps
    57  
    58  @@option device-write-bps
    59  
    60  #### **--dns**=*ipaddr*
    61  
    62  Set custom DNS servers in the /etc/resolv.conf file that is shared between all containers in the pod. A special option, "none" is allowed which disables creation of /etc/resolv.conf for the pod.
    63  
    64  #### **--dns-option**=*option*
    65  
    66  Set custom DNS options in the /etc/resolv.conf file that is shared between all containers in the pod.
    67  
    68  #### **--dns-search**=*domain*
    69  
    70  Set custom DNS search domains in the /etc/resolv.conf file that is shared between all containers in the pod.
    71  
    72  #### **--exit-policy**=**continue** | *stop*
    73  
    74  Set the exit policy of the pod when the last container exits.  Supported policies are:
    75  
    76  | Exit Policy        | Description                                                                                                                |
    77  | ------------------ | -------------------------------------------------------------------------------------------------------------------------- |
    78  | *continue*         | The pod continues running, by keeping its infra container alive, when the last container exits. Used by default.           |
    79  | *stop*             | The pod (including its infra container) is stopped when the last container exits. Used in `kube play`.                     |
    80  
    81  @@option gidmap.pod
    82  
    83  @@option gpus
    84  
    85  #### **--help**, **-h**
    86  
    87  Print usage statement.
    88  
    89  @@option hostname.pod
    90  
    91  #### **--infra**
    92  
    93  Create an infra container and associate it with the pod. An infra container is a lightweight container used to coordinate the shared kernel namespace of a pod. Default: true.
    94  
    95  @@option infra-command
    96  
    97  @@option infra-conmon-pidfile
    98  
    99  #### **--infra-image**=*image*
   100  
   101  The custom image that is used for the infra container.  Unless specified, Podman builds a custom local image which does not require pulling down an image.
   102  
   103  @@option infra-name
   104  
   105  @@option ip
   106  
   107  @@option ip6
   108  
   109  @@option label
   110  
   111  @@option label-file
   112  
   113  @@option mac-address
   114  
   115  @@option memory
   116  
   117  @@option memory-swap
   118  
   119  #### **--name**, **-n**=*name*
   120  
   121  Assign a name to the pod.
   122  
   123  @@option network
   124  
   125  Invalid if using **--dns**, **--dns-option**, or **--dns-search** with **--network** set to **none** or **container:**_id_.
   126  
   127  @@option network-alias
   128  
   129  @@option no-hosts
   130  
   131  This option conflicts with **--add-host**.
   132  
   133  @@option pid.pod
   134  
   135  #### **--pod-id-file**=*path*
   136  
   137  Write the pod ID to the file.
   138  
   139  @@option publish
   140  
   141  **Note:** You must not publish ports of containers in the pod individually,
   142  but only by the pod itself.
   143  
   144  **Note:** This cannot be modified once the pod is created.
   145  
   146  @@option replace
   147  
   148  @@option restart
   149  
   150  Default restart policy for all the containers in a pod.
   151  
   152  @@option security-opt
   153  
   154  #### **--share**=*namespace*
   155  
   156  A comma-separated list of kernel namespaces to share. If none or "" is specified, no namespaces are shared, and the infra container is not created unless explicitly specified via **--infra=true**. The namespaces to choose from are cgroup, ipc, net, pid, uts. If the option is prefixed with a "+", the namespace is appended to the default list. Otherwise, it replaces the default list. Defaults match Kubernetes default (ipc, net, uts)
   157  
   158  #### **--share-parent**
   159  
   160  This boolean determines whether or not all containers entering the pod use the pod as their cgroup parent. The default value of this option is true. Use the **--share** option to share the cgroup namespace rather than a cgroup parent in a pod.
   161  
   162  Note: This option conflicts with the **--share=cgroup** option since that option sets the pod as the cgroup parent but enters the container into the same cgroupNS as the infra container.
   163  
   164  @@option shm-size
   165  
   166  @@option shm-size-systemd
   167  
   168  @@option subgidname
   169  
   170  @@option subuidname
   171  
   172  @@option sysctl
   173  
   174  @@option uidmap.pod
   175  
   176  @@option userns.pod
   177  
   178  @@option uts.pod
   179  
   180  @@option volume
   181  
   182  @@option volumes-from
   183  
   184  ## EXAMPLES
   185  
   186  Create a named pod.
   187  ```
   188  $ podman pod create --name test
   189  ```
   190  
   191  Create a named pod.
   192  ```
   193  $ podman pod create mypod
   194  ```
   195  
   196  Create a pod without an infra container.
   197  ```
   198  $ podman pod create --infra=false
   199  ```
   200  
   201  Create a named pod with infra container command to run.
   202  ```
   203  $ podman pod create --infra-command /top toppod
   204  ```
   205  
   206  Create a pod with published ports on the host.
   207  ```
   208  $ podman pod create --publish 8443:443
   209  ```
   210  
   211  Create a pod with the specified network configuration.
   212  ```
   213  $ podman pod create --network slirp4netns:outbound_addr=127.0.0.1,allow_host_loopback=true
   214  ```
   215  
   216  Create a pod with the specified network.
   217  ```
   218  $ podman pod create --network pasta
   219  ```
   220  
   221  Create a pod on two networks.
   222  ```
   223  $ podman pod create --network net1:ip=10.89.1.5 --network net2:ip=10.89.10.10
   224  ```
   225  
   226  ## SEE ALSO
   227  **[podman(1)](podman.1.md)**, **[podman-pod(1)](podman-pod.1.md)**, **[podman-kube-play(1)](podman-kube-play.1.md)**, **containers.conf(1)**, **[cgroups(7)](https://man7.org/linux/man-pages/man7/cgroups.7.html)**
   228  
   229  
   230  ## HISTORY
   231  July 2018, Originally compiled by Peter Hunt <pehunt@redhat.com>
   232  
   233  ## FOOTNOTES
   234  <a name="Footnote1">1</a>: The Podman project is committed to inclusivity, a core value of open source. The `master` and `slave` mount propagation terminology used here is problematic and divisive, and needs to 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.