Created
August 11, 2020 22:53
-
-
Save rms1000watt/074977990c97247a6176f0ed98d46d1a to your computer and use it in GitHub Desktop.
locally list docker containers and their ip addresses
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Courtesy: https://stackoverflow.com/a/20686101 | |
| docker ps -a | grep -v CONTAINER | cut -d' ' -f1 | xargs docker inspect -f '{{.Config.Image}}{{"\t"}}{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment