Jump to content

Linux/Docker/Variables & Snippets

From Wiki
Revision as of 11:46, 17 July 2019 by Marcluer (talk | contribs)

Docker Host IP

ip -4 route list match 0/0 | cut -d' ' -f3

List all container IPs

docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'