Skip to content

Instantly share code, notes, and snippets.

@antonioanerao
Created May 6, 2024 14:45
Show Gist options
  • Save antonioanerao/2f1a70b0e5066cd1d6a56af5eae99ca3 to your computer and use it in GitHub Desktop.
Save antonioanerao/2f1a70b0e5066cd1d6a56af5eae99ca3 to your computer and use it in GitHub Desktop.
Lista os IPs dos containers docker
#!/bin/bash
docker ps --format "{{.Names}}" | while read container; do
ip=$(docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container")
printf "%-40.40s\t%s\t%s\n" "$container" "$ip"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment