Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I can't use a specific port with a docker container

I don’t manage to make the docker-compose up work.

When I enter it, I immediately get those errors :

Starting test_application_1 ... 
Starting test_application_1 ... error

ERROR: for test_application_1  Cannot start service application: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use

ERROR: for application  Cannot start service application: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use
ERROR: Encountered errors while bringing up the project.

So I used netstat (I typed netstat -av | grep 5000 on the MacOS terminal) to see if the 5000 port was used but the command doesn’t display it so I don’t think it’s actually used…

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here is the content of the docker-compose.yml file :

version: "3"
services:
redis:
image: redis
application:
image: some_application
ports:
– 5000:5000

The image some_application is from an exercise.

Anyone knows what is happening and how to fix this problem ?

Thx !

>Solution :

I found this article here.

Port 5000 already in use — MacOS Monterey issue | by Anand Tripathi | Pythonistas | Medium

It appears that this is happening with one of the versions of macOS Monterey.

The solution would be to turn off the AirPlay Receiver as mentioned in the above article, or use a port other than 5000.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading