Site icon Bytefreaks.net

How to List all Docker Container Names and their IPs

Advertisements

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: Αγγλικα

Exit mobile version