获取单个IP
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-ID>
获取所有容器IP
docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
获取单个IP
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-ID>
获取所有容器IP
docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
转载于:https://www.cnblogs.com/Tempted/p/7774789.html