Crbreingan
Crbreingan

Reputation: 639

Docker containers cannot bind to network

I usually use the default network for docker containers, and I had a mongo database running in one just fine and the port was exposed to the network successfully. Then, I tried to attach a new python container to that container using the --link option (yes, I now realize that that is deprecated). An error was thrown, and in my hubris, I didn't capture it, I just went on. Now, when I try to start my mongo database, it fails saying that it can't bind the network. "Failed to set up listener: SocketException: Permission denied"

I removed the container and tried to re-create it, but no luck. I've put this into a permanent state of bad. Any suggestions on how to fix this so I can get my database back?

Thanks.

Edit: Should have mentioned, Ubuntu 20.04, Docker 19.03.11 Also, this only seems to be a problem with any new mongo containers. I can start postgres, and web servers, etc without issues.

Upvotes: 3

Views: 388

Answers (1)

Crbreingan
Crbreingan

Reputation: 639

Turns out, whatever that error was when I tried to use --link, it had corrupted the mongo image on my machine, so all new instances of that image failed to connect to the network. That's why removing the container and recreating it didn't fix the problem. I needed to delete the local mongo image, and re-pull from the docker hub.

Upvotes: 2

Related Questions