Skip to content

Instantly share code, notes, and snippets.

@maxcnunes
Created March 18, 2019 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxcnunes/3e64a3422564f88b5629da5a0ccd4fc1 to your computer and use it in GitHub Desktop.
Save maxcnunes/3e64a3422564f88b5629da5a0ccd4fc1 to your computer and use it in GitHub Desktop.
Docker - list all containers' ip and find container by ip
for i in $(docker ps -aq); do docker inspect -f '{{.Name}}: IP={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$i"; done | grep <ip-here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment