简体   繁体   中英

Can't see open ports of Docker PostgreSQL container?

I have a container running with PostgreSQL, expose port 5432, but can not find them when running lsof -Pn -i4 or netstat | grep 5432 netstat | grep 5432 .

I can however connect with the database through my Spring Boot application.

Why can't I see the open ports on my local machine of the docker container?

尝试使用netstat -a它将显示所有活动连接,即充当服务器的端口(某些服务正在侦听这些端口以获取来自不同机器/进程的连接)和已建立(在这些端口上建立连接,而不管事实上主机/服务可以是服务器或客户端)

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