#!/bin/sh
for containername in $(docker ps --format '{{.Names}}'); do
    interfacenum=$(docker exec -i $containername cat /sys/class/net/eth0/iflink)
    echo $containername
    echo -n '  '
    ip addr | grep ^$interfacenum: | sed 's/@.*$//'
done
