Created
April 13, 2016 16:34
-
-
Save jrumbut/796c07a1330c02bb2804b42ae02b968c to your computer and use it in GitHub Desktop.
Helpful Docker function, gives you Hostname (often shortened container id), name, IP address, and port bindings for all running containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#defines function for later use, put it in .bashrc or similar | |
#usage: docker-net | |
#output: | |
#bdc5fb58bc94 /adoring_euler 172.17.0.3 map[8888/tcp:[{ 8888}]] | |
#c7591aa275ff /hopeful_davinci 172.17.0.2 map[6006/tcp:[{ 32769}] 8888/tcp:[{ 80}]] | |
docker-net() { | |
docker inspect --format '{{ .Config.Hostname }} {{ .Name }} {{ .NetworkSettings.IPAddress }} {{ .HostConfig.PortBindings }}' $(docker ps -q); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this! :)