I\'d like to retrieve the port mapped to a container using docker inspect, I found something like that:
docker inspect --format=\" {{ .NetworkSettings.Ports }} \
See also my answer How to get ENV variable when doing Docker Inspect I guess you can adapt and get directly what you want