Prints all Docker container MAC addresses with container ID and name for easy reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ID in `docker ps -q`; do | |
NAME=$(docker inspect -f '{{.Config.Image}}' "${ID}") | |
MAC=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' "${ID}") | |
echo "${ID} :: ${MAC} :: ${NAME}"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment