github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-pod-create.1.md (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*]
     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 id is printed to STDOUT. You can then use
    13  **podman create --pod \<pod_id|pod_name\> ...** to add containers to the pod, and
    14  **podman pod start \<pod_id|pod_name\>** to start the pod.
    15  
    16  ## OPTIONS
    17  
    18  #### **--add-host**=_host_:_ip_
    19  
    20  Add a host to the /etc/hosts file shared between all containers in the pod.
    21  
    22  #### **--cgroup-parent**=*path*
    23  
    24  Path to cgroups under which the cgroup for the pod 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.
    25  
    26  #### **--dns**=*ipaddr*
    27  
    28  Set custom DNS servers in the /etc/resolv.conf file that will be shared between all containers in the pod. A special option, "none" is allowed which disables creation of /etc/resolv.conf for the pod.
    29  
    30  #### **--dns-opt**=*option*
    31  
    32  Set custom DNS options in the /etc/resolv.conf file that will be shared between all containers in the pod.
    33  
    34  #### **--dns-search**=*domain*
    35  
    36  Set custom DNS search domains in the /etc/resolv.conf file that will be shared between all containers in the pod.
    37  
    38  #### **--help**
    39  
    40  Print usage statement.
    41  
    42  #### **--hostname**=name
    43  
    44  Set a hostname to the pod
    45  
    46  #### **--infra**=**true**|**false**
    47  
    48  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.
    49  
    50  #### **--infra-conmon-pidfile**=*file*
    51  
    52  Write the pid of the infra container's **conmon** process to a file. As **conmon** runs in a separate process than Podman, this is necessary when using systemd to manage Podman containers and pods.
    53  
    54  #### **--infra-command**=*command*
    55  
    56  The command that will be run to start the infra container. Default: "/pause".
    57  
    58  #### **--infra-image**=*image*
    59  
    60  The image that will be created for the infra container. Default: "k8s.gcr.io/pause:3.1".
    61  
    62  #### **--ip**=*ipaddr*
    63  
    64  Set a static IP for the pod's shared network.
    65  
    66  #### **--label**=*label*, **-l**
    67  
    68  Add metadata to a pod (e.g., --label com.example.key=value).
    69  
    70  #### **--label-file**=*label*
    71  
    72  Read in a line delimited file of labels.
    73  
    74  #### **--mac-address**=*address*
    75  
    76  Set a static MAC address for the pod's shared network.
    77  
    78  #### **--name**=*name*, **-n**
    79  
    80  Assign a name to the pod.
    81  
    82  #### **--network**=*mode*, **--net**
    83  
    84  Set network mode for the pod. Supported values are
    85  - **bridge**: Create a network stack on the default bridge. This is the default for rootful containers.
    86  - **host**: Do not create a network namespace, all containers in the pod will use the host's network. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
    87  - Comma-separated list of the names of CNI networks the pod should join.
    88  - **slirp4netns[:OPTIONS,...]**: use slirp4netns to create a user network stack.  This is the default for rootless containers.  It is possible to specify these additional options:
    89    - **allow_host_loopback=true|false**: Allow the slirp4netns to reach the host loopback IP (`10.0.2.2`). Default is false.
    90    - **cidr=CIDR**: Specify ip range to use for this network. (Default is `10.0.2.0/24`).
    91    - **enable_ipv6=true|false**: Enable IPv6. Default is false. (Required for `outbound_addr6`).
    92    - **outbound_addr=INTERFACE**: Specify the outbound interface slirp should bind to (ipv4 traffic only).
    93    - **outbound_addr=IPv4**: Specify the outbound ipv4 address slirp should bind to.
    94    - **outbound_addr6=INTERFACE**: Specify the outbound interface slirp should bind to (ipv6 traffic only).
    95    - **outbound_addr6=IPv6**: Specify the outbound ipv6 address slirp should bind to.
    96    - **port_handler=rootlesskit**: Use rootlesskit for port forwarding. Default.
    97    - **port_handler=slirp4netns**: Use the slirp4netns port forwarding.
    98  
    99  #### **--network-alias**=strings
   100  
   101  Add a DNS alias for the container. When the container is joined to a CNI network with support for the dnsname plugin, the container will be accessible through this name from other containers in the network.
   102  
   103  #### **--no-hosts**=**true**|**false**
   104  
   105  Disable creation of /etc/hosts for the pod.
   106  
   107  #### **--pod-id-file**=*path*
   108  
   109  Write the pod ID to the file.
   110  
   111  #### **--publish**=*port*, **-p**
   112  
   113  Publish a port or range of ports from the pod to the host.
   114  
   115  Format: `ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort`
   116  Both hostPort and containerPort can be specified as a range of ports.
   117  When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range.
   118  Use `podman port` to see the actual mapping: `podman port CONTAINER $CONTAINERPORT`.
   119  
   120  NOTE: This cannot be modified once the pod is created.
   121  
   122  #### **--replace**=**true**|**false**
   123  
   124  If another pod with the same name already exists, replace and remove it.  The default is **false**.
   125  
   126  #### **--share**=*namespace*
   127  
   128  A comma delimited list of kernel namespaces to share. If none or "" is specified, no namespaces will be shared. The namespaces to choose from are ipc, net, pid, uts.
   129  
   130  The operator can identify a pod in three ways:
   131  UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)
   132  UUID short identifier (“f78375b1c487”)
   133  Name (“jonah”)
   134  
   135  podman generates a UUID for each pod, and if a name is not assigned
   136  to the container with **--name** then a random string name will be generated
   137  for it. The name is useful any place you need to identify a pod.
   138  
   139  ## EXAMPLES
   140  
   141  ```
   142  $ podman pod create --name test
   143  
   144  $ podman pod create --infra=false
   145  
   146  $ podman pod create --infra-command /top
   147  
   148  $ podman pod create --publish 8443:443
   149  
   150  $ podman pod create --network slirp4netns:outbound_addr=127.0.0.1,allow_host_loopback=true
   151  
   152  $ podman pod create --network slirp4netns:cidr=192.168.0.0/24
   153  ```
   154  
   155  ## SEE ALSO
   156  podman-pod(1)
   157  
   158  ## HISTORY
   159  July 2018, Originally compiled by Peter Hunt <pehunt@redhat.com>