Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created August 11, 2020 22:53
Show Gist options
  • Save rms1000watt/074977990c97247a6176f0ed98d46d1a to your computer and use it in GitHub Desktop.
Save rms1000watt/074977990c97247a6176f0ed98d46d1a to your computer and use it in GitHub Desktop.
locally list docker containers and their ip addresses
#!/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