Skip to content

Instantly share code, notes, and snippets.

@lee-pai-long
Created January 20, 2016 09:34
Show Gist options
  • Save lee-pai-long/7eeaab936f4a03e28598 to your computer and use it in GitHub Desktop.
Save lee-pai-long/7eeaab936f4a03e28598 to your computer and use it in GitHub Desktop.

Get a container IP using container ID

$ [sudo] docker inspect --format '{{ .NetworkSettings.IPAddress }}' CONTAINER_ID

Add this function to ~/.bashrc

docker-ip() { [sudo] docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment