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…
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.