How to List all Docker Container Names and their IPs

The following command will make a list with all docker container names and their respective IPs.
For the containers that have multiple IPs it will printed them on the same row as their name.

docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} {{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' | sed 's#^/##';


This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.