Search code examples
dockerport

docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use


I am new and trying out this tutorial from DigitalOcean but when I do docker run -p 5000:5000 flask_demo:v0, I am getting the following error.

docker:

Error response from daemon: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use.

Please help me


Solution

  • Then you just bind another port

    docker run -p 5001:5000 flask_demo:v0
    

    -p 5001:5000 basically means, bind port 5001 in my host machine with the port 5000 in the container. Since port 5000 already used in your host machine, then u can bind with another port example: port 5001