Skip to content

Instantly share code, notes, and snippets.

@tanasecosminromeo
Last active September 26, 2017 15:29
Show Gist options
  • Save tanasecosminromeo/3a31e980f00eebf746dd0d73a5451378 to your computer and use it in GitHub Desktop.
Save tanasecosminromeo/3a31e980f00eebf746dd0d73a5451378 to your computer and use it in GitHub Desktop.
List all docker networks with their Gateway
#!/bin/bash
docker ps -a --quiet "$@" | xargs --no-run-if-empty docker inspect --format='{{range $net, $conf := .NetworkSettings.Networks}}{{$conf.Gateway}} {{$net}}{{end}}' | column -t -s '|' | sort -u -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment