Created
August 31, 2022 11:02
-
-
Save orihomie/c9a2be3192361803acb3144164ca2c80 to your computer and use it in GitHub Desktop.
Inspect docker networks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
networks=($(docker network ls | awk '{print $1}' | tail -n+2)) | |
delta=1 | |
arraylength=${#networks[@]} | |
for (( i=0; i<${arraylength}; i=$((i+$delta)) )); | |
do | |
docker network inspect --format='{{.Name}} {{.IPAM.Config}}' ${networks[i]}; | |
#docker network inspect ${networks[i]} | grep Subnet | |
echo "${networks[i]} checked" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment