How to view all tcp port mappings

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

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

Found a better way where it shows container ID, container name and container port

alias dport='docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a'

source: https://stackoverflow.com/a/59068229