docker查看映射端口:

[root@VM_0_2_centos local]# docker port b041040f37d3
3306/tcp -> 0.0.0.0:3305

#命令:

docker port  COMMAND

[root@VM_0_2_centos local]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
a1bf36857723        mysql               "docker-entrypoint..."   7 weeks ago         Up 8 hours          33060/tcp, 0.0.0.0:3304->3306/tcp   mysqlprod
b041040f37d3        mysql               "docker-entrypoint..."   3 months ago        Up 8 hours          33060/tcp, 0.0.0.0:3305->3306/tcp   mysql
[root@VM_0_2_centos local]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker.io/mysql     latest              be0dbf01a0f3        3 months ago        541 MB
[root@VM_0_2_centos local]# docker port be0dbf01a0f3
Error: No such container: be0dbf01a0f3
[root@VM_0_2_centos local]# docker port a1bf36857723
3306/tcp -> 0.0.0.0:3304
[root@VM_0_2_centos local]# docker port b041040f37d3
3306/tcp -> 0.0.0.0:3305

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐