Skip to content

Commit

Permalink
add docker-network-info
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed Dec 5, 2024
1 parent ea6ce49 commit 203b8a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/docker-networks-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

for network in $(docker network ls -q); do
echo "Network: $(docker network inspect "${network}" -f '{{.Name}}') - ${network}"
echo " Addresses In Use"
docker network inspect --format '{{range $k, $v := .Containers}} {{$v.Name}}: {{$v.IPv4Address}}{{println}}{{end}}' "${network}"

echo " Address Pool"
docker network inspect --format ' {{.Name}}: {{range .IPAM.Config}}{{.Subnet}}{{end}}' "${network}"
echo "----------------------------------------------"
done

0 comments on commit 203b8a5

Please sign in to comment.