Created
March 10, 2016 02:16
-
-
Save gg7/09f4eb25bb4caa2744f6 to your computer and use it in GitHub Desktop.
Get all IP addresses of all Docker containers
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
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
docker inspect $(docker ps -q) \ | |
| jq -c '.[] | {name: .["Name"], ips: .["NetworkSettings"]["Networks"] | map(.IPAddress)} | [.name, .ips]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment