Linux/Docker/Variables & Snippets: Difference between revisions

From Wiki
< Linux‎ | Docker
(Die Seite wurde neu angelegt: „== Docker Host IP == <pre> ip -4 route list match 0/0 | cut -d' ' -f3 </pre>“)
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
ip -4 route list match 0/0 | cut -d' ' -f3
ip -4 route list match 0/0 | cut -d' ' -f3
</pre>
</pre>
== List all container IPs ==
<pre>
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
</pre>
[[Category:Linux/Docker]]
[[Category:Linux]]

Latest revision as of 11:46, 17 July 2019

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/ \// /'