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
Post a Comment