docker port
Table of Contents:
Command Name:
docker port
Description:
List port mappings or a specific mapping for the container.
Syntax:
easywhatis$ docker port --help
Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]
List port mappings or a specific mapping for the container
easywhatis$
Example:
easywhatis$ docker run -it --rm -p 8080:80 -p 8090:90 -d busybox
0739df8d34943d0329d3e3ecbb1166e74d6f85c903fb253f23ca3fa7cd621d80
easywhatis$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0739df8d3494 busybox "sh" 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp, 0.0.0.0:8090->90/tcp awesome_roentgen
a5bb226d1850 ubuntu "bash" 8 hours ago Up 7 minutes eloquent_knuth
easywhatis$ docker ports 0739df8d3494
docker: 'ports' is not a docker command.
See 'docker --help'
easywhatis$ docker port 0739df8d3494
80/tcp -> 0.0.0.0:8080
90/tcp -> 0.0.0.0:8090
easywhatis$