标签:inspect int nbsp style network color 0.11 ipa print
docker inspect node1 |grep IPAddress |tail -1 |awk ‘{print $2}‘ |tr ‘"‘ " " |tr ‘,‘ ‘ ‘ # 可以用容器id或名称
方法二:
docker inspect --format ‘{{ .NetworkSettings.IPAddress }}‘ node1 # 容器id或者名称
显示所有容器的IP
docker inspect --format=‘{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}‘ $(docker ps -aq)
/node1 - 172.17.0.15
/n11 - 172.17.0.14
/n10 - 172.17.0.13
/n9 - 172.17.0.12
/n8 - 172.17.0.11
/n7 - 172.17.0.10
/n6 - 172.17.0.9
/n5 - 172.17.0.8
/n4 - 172.17.0.7
/n3 - 172.17.0.6
/n2 - 172.17.0.5
/n1 - 172.17.0.4
标签:inspect int nbsp style network color 0.11 ipa print
原文地址:https://www.cnblogs.com/kaishirenshi/p/10375203.html