简体   繁体   中英

I'm trying to list all containers that have port 80 or say 443 published

The question is very simple, How to list containers that have ports 80 and 443 published?

have gone through docker documentation, but couldn't find much. - docker port containerID => this will show the port details for specific Container

Make use of --filter option of docker ps command.

docker ps --filter "publish=80" --filter "publish=443"

Hope this helps.

use a combination of format and filter

docker ps -a --format 'table {{ .Names }} \t {{ .Ports }}' --filter publish=443 --filter publish=80

or using expose filter:

docker ps -a --format 'table {{ .Names }} \t {{ .Ports }}' --filter expose=443

get a range of posrts :

docker ps --format 'table {{ .Names }} \t {{ .Ports }}' --filter expose=8000-8080/tcp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM