简体   繁体   中英

Containers don't have ports

I have some weird issue. All of my 8 containers are running and they are up, but non of them are showing ports (they are blank) on docker ps -a .

The weirdest thing is that all of those containers have been running normally last night showing ports on all of them. Also, I can enter each of those containers without any problems using docker exec -it <container_id> /bin/bash .

I have restarted my server and ports are still not showing up.

Server: Physical

OS: CentOS

Client: Version: 18.06.0-ce API version: 1.38 Go version: go1.10.3 Git commit: 0ffa825 Built: Wed Jul 18 19:08:18 2018 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 18.06.0-ce API version: 1.38 (minimum version 1.12) Go version: go1.10.3 Git commit: 0ffa825 Built: Wed Jul 18 19:10:42 2018 OS/Arch: linux/amd64 Experimental: false

EDIT: I have used this https://pastebin.com/qZdQCjw1 docker-compose for init installation of all those apps in docker-compose file. After that I didn't change anything. This is a long shot, but could it be that I have installed docker-swarm and uninstalled it 1 min after installation that docker swarm change something, so I can't see ports for my containers?

I figure it out. I have tried to set specifically bridge network and assign it to all containers in docker-compose file. I have played with docker swarm for a minute and when I removed everything related to docker swarm, it still had overlay network, which is the reason why I missed ports. I had to manually set bridge and assign it to all services in docker-compose file and now it works like a charm.

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