How to List all Docker Container Names and their IPs 1


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#^/##';

Advertisements

This post is also available in: Greek


Leave a Reply to AMAR Cancel reply

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

One thought on “How to List all Docker Container Names and their IPs