Skip to content

Instantly share code, notes, and snippets.

@gg7
Created March 10, 2016 02:16
Show Gist options
  • Save gg7/09f4eb25bb4caa2744f6 to your computer and use it in GitHub Desktop.
Save gg7/09f4eb25bb4caa2744f6 to your computer and use it in GitHub Desktop.
Get all IP addresses of all Docker containers
#!/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