Skip to content

Instantly share code, notes, and snippets.

@StoneLabs
Last active January 11, 2024 17:17
Show Gist options
  • Save StoneLabs/f946e87f17fcdfac54c21e4254c09743 to your computer and use it in GitHub Desktop.
Save StoneLabs/f946e87f17fcdfac54c21e4254c09743 to your computer and use it in GitHub Desktop.
List All Fixed and Current IPs of all containers in macvlan setup
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