Last active
January 11, 2024 17:17
-
-
Save StoneLabs/f946e87f17fcdfac54c21e4254c09743 to your computer and use it in GitHub Desktop.
List All Fixed and Current IPs of all containers in macvlan setup
This file contains hidden or 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
echo "" | |
docker container ls --all -q | | |
xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAMConfig.IPv4Address}}{{end}} | {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} | {{ .Name }}' | | |
sort | | |
sed '1 iCustom IP | Current IP | Container\n||' | | |
column -t -s "|" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment