Skip to content

Instantly share code, notes, and snippets.

@orihomie
Created August 31, 2022 11:02
Show Gist options
  • Save orihomie/c9a2be3192361803acb3144164ca2c80 to your computer and use it in GitHub Desktop.
Save orihomie/c9a2be3192361803acb3144164ca2c80 to your computer and use it in GitHub Desktop.
Inspect docker networks
#!/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