github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/port.md (about)

     1  ---
     2  title: "port"
     3  description: "The port command description and usage"
     4  keywords: "port, mapping, container"
     5  ---
     6  
     7  # port
     8  
     9  ```markdown
    10  Usage:  docker port CONTAINER [PRIVATE_PORT[/PROTO]]
    11  
    12  List port mappings or a specific mapping for the container
    13  
    14  Options:
    15        --help   Print usage
    16  ```
    17  
    18  ## Examples
    19  
    20  ### Show all mapped ports
    21  
    22  You can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or
    23  just a specific mapping:
    24  
    25  ```bash
    26  $ docker ps
    27  
    28  CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES
    29  b650456536c7        busybox:latest      top                 54 minutes ago      Up 54 minutes       0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp   test
    30  
    31  $ docker port test
    32  
    33  7890/tcp -> 0.0.0.0:4321
    34  9876/tcp -> 0.0.0.0:1234
    35  
    36  $ docker port test 7890/tcp
    37  
    38  0.0.0.0:4321
    39  
    40  $ docker port test 7890/udp
    41  
    42  2014/06/24 11:53:36 Error: No public port '7890/udp' published for test
    43  
    44  $ docker port test 7890
    45  
    46  0.0.0.0:4321
    47  ```