docker inspect [OPTIONS] NAME|ID [NAME|ID...]
Get an instance’s IP address
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
Get an instance’s MAC address
docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID
Get an instance’s log path
docker inspect --format='{{.LogPath}}' $INSTANCE_ID
Get an instance’s image name
docker inspect --format='{{.Config.Image}}' $INSTANCE_ID
List all port bindings
docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
Find a specific port mapping
docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
Get a subsection in JSON format
docker inspect --format='{{json .Config}}' $INSTANCE_ID