Docker Community Forums

Share and learn in the Docker community.

How to view all tcp port mappings

docker

(Iancollins) #1

Hi,
What is the fastest way to show all ports that are being mapped to containers on a host.
I know I can do something like

docker ps --format “{{.Ports}}”

but is that the fastest way?

Cheers,
Ian


(Todd W.) #2

probably best way is the command you gave.
might be easier to alias it in your .bashrc
alias dport='docker ps --format "{{.Ports}}"'
and then source your .bashrc