docker查看容器占用的端口

[root@yang ~]# docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED       STATUS       PORTS     NAMES
a21ef3e7dfce   apache/apisix:2.8-alpine        "sh -c ‘/usr/bin/api…"   7 hours ago   Up 7 hours             apisix
e453c3731527   bitnami/etcd:latest             "/opt/bitnami/script…"   7 hours ago   Up 7 hours             etcd
8810009148c6   apache/apisix-dashboard:2.7.1   "/usr/local/apisix-d…"   7 hours ago   Up 7 hours             apisix-dashboard
f30ef340342d   mysql:5.7.34                    "docker-entrypoint.s…"   2 weeks ago   Up 2 weeks             mysql5.7
[root@yang ~]# docker inspect 8 | grep tcp
                "9000/tcp": {}
[root@yang ~]# docker inspect f | grep tcp
                "3306/tcp": {},
                "33060/tcp": {}
[root@yang ~]# docker inspect e | grep tcp  # docker ps -a 还有以e开头的容器
Error response from daemon: Multiple IDs found with provided prefix: e
[root@yang ~]# docker inspect e4 | grep tcp
                "2379/tcp": {},
                "2380/tcp": {}
[root@yang ~]# docker inspect a2 | grep tcp
                "9080/tcp": {},
                "9443/tcp": {}

docker查看容器占用的端口

上一篇:信息安全-第五章


下一篇:使用 go 实现优先队列