Docker inspect format retrieve port mapping -


i'd retrieve port mapped container using docker inspect, found that:

docker inspect --format=" {{ .networksettings.ports }} " containerid 

output:

map[1234/tcp:[map[hostip:0.0.0.0 hostport:49159]] 3306/tcp:<nil> 4444/tcp:<nil> 4567/tcp:<nil> 4568/tcp:<nil>] 

but i'd have output this:

1234/tcp:49159 

is possible ?

see answer how env variable when doing docker inspect guess can adapt , directly want


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -