Docker container blocking my server

Hello,

I have subscribed 2x online VPS that are run into Proxmox.

On one of them i have installed Ubuntu 22.04 and Virtualmin/webmin.

I also installed docker following the procedure for ubuntu.

for some reason i need to use mysql 5.7 into a container, so i pulled image mysql 5.7

then i ran the following command :

 docker run -d --restart=always -p 3307:3306 --name my_container_name -e MYSQL_ROOT_PASSWORD=xxx mysql:5.7 

unfortunatly when i run this command, my server become unreachable with its public ip, will not respond to ping and all services become unreachanble.

for some reasons the server is reachable from the other vps with its public ip.

Im not a network expert and i dont see any logic in this. of course port 3307 is not used by something else in the server.

how can i figure out why the server become unreachable when i run the container ?

The container throw an error and not start, if another process already listens on port 3307 on any of the ips.

I would suggest asking the VPS support. They should know whether it’s a common problem and how to work around it.

You can try to troubleshoot the issue by investigating the daemon logs:
https://docs.docker.com/config/daemon/logs

in my case, no errors, container run well, i can connect to mysql inside the container via port 3307, do operations, everything ok.

just server become unreachable. when i shut down the container, the server become reachable again !

I contacter customer service of vps, they replyed that i messed up with the firewall, witch is not true. i even turned it of to check, it did not change anything. They said they cannot help unless i give them the vps credentials, thing that i cannot do.

Im exploring the logs, but so far, nothing seems to show why server become unreachable.

can the container block all server ports ? or desactivate the main network interface ? if yes, is there a way to prevent it doing that ?

Docker of course tinkers around with the iptables rules. You can check them with sudo iptables -L before the container is started and after.

Why would docker block all server ports or deactivate network interfaces? Who would use Docker if this would be a default behavior? Personally, I never experienced the behavior you experience during the last 9 years.

i decided to downgrade to unbuntu 20.04, things seems to go better. I cannot explain why…