github.com/olljanat/moby@v1.13.1/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  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # port
    17  
    18  ```markdown
    19  Usage:  docker port CONTAINER [PRIVATE_PORT[/PROTO]]
    20  
    21  List port mappings or a specific mapping for the container
    22  
    23  Options:
    24        --help   Print usage
    25  ```
    26  
    27  You can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or
    28  just a specific mapping:
    29  
    30      $ docker ps
    31      CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES
    32      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
    33      $ docker port test
    34      7890/tcp -> 0.0.0.0:4321
    35      9876/tcp -> 0.0.0.0:1234
    36      $ docker port test 7890/tcp
    37      0.0.0.0:4321
    38      $ docker port test 7890/udp
    39      2014/06/24 11:53:36 Error: No public port '7890/udp' published for test
    40      $ docker port test 7890
    41      0.0.0.0:4321