Docker 列出容器 IP

来自姬鸿昌的知识库
跳到导航 跳到搜索
[root@localhost ~]# docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} {{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' | sed 's#^/##';
zk2  172.20.0.4
zk3  172.20.0.2
zk1  172.20.0.3
[root@localhost ~]#