github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/options/publish.md (about)

     1  ####> This option file is used in:
     2  ####>   podman create, pod create, run
     3  ####> If file is edited, make sure the changes
     4  ####> are applicable to all of those.
     5  #### **--publish**, **-p**=*[[ip:][hostPort]:]containerPort[/protocol]*
     6  
     7  Publish a container's port, or range of ports,<<| within this pod>> to the host.
     8  
     9  Both *hostPort* and *containerPort* can be specified as a range of ports.
    10  When specifying ranges for both, the number of container ports in the
    11  range must match the number of host ports in the range.
    12  
    13  If host IP is set to 0.0.0.0 or not set at all, the port is bound on all IPs on the host.
    14  
    15  By default, Podman publishes TCP ports. To publish a UDP port instead, give
    16  `udp` as protocol. To publish both TCP and UDP ports, set `--publish` twice,
    17  with `tcp`, and `udp` as protocols respectively. Rootful containers can also
    18  publish ports using the `sctp` protocol.
    19  
    20  Host port does not have to be specified (e.g. `podman run -p 127.0.0.1::80`).
    21  If it is not, the container port is randomly assigned a port on the host.
    22  
    23  Use **podman port** to see the actual mapping: `podman port $CONTAINER $CONTAINERPORT`.
    24  
    25  Note that the network drivers `macvlan` and `ipvlan` do not support port forwarding,
    26  it will have no effect on these networks.