Linux/Docker/Networking: Difference between revisions

From Wiki
< Linux‎ | Docker
mNo edit summary
mNo edit summary
Line 1: Line 1:
* List docker container with IPs
* List docker container with IPs
<pre>
<pre>
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}} {{ .Name }}' | sed 's/ \// /'
</pre>
</pre>



Revision as of 20:10, 15 November 2023

  • List docker container with IPs
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}} {{ .Name }}' | sed 's/ \// /'
  • Create docker network
docker network create wireguard
docker network create --subnet 172.1.50.0/24 wireguard
docker network inspect wireguard