Docker Error bind: address already in use

后端 未结 20 1253
情深已故
情深已故 2020-11-28 03:28

When I run docker-compose up in my Docker project it failes with the following message:

Error starting userland proxy: listen tcp 0.0.0.0:3000:          


        
相关标签:
20条回答
  • 2020-11-28 03:34

    In your case it was some other process that was using the port and as indicated in the comments, sudo netstat -pna | grep 3000 helped you in solving the problem.

    While in other cases (I myself encountered it many times) it mostly is the same container running at some other instance. In that case docker ps was very helpful as often I left the same containers running in other directories and then tried running again at other places, where same container names were used.

    How docker ps helped me: docker rm -f $(docker ps -aq) is a short command which I use to remove all containers.

    Edit: Added how docker ps helped me.

    0 讨论(0)
  • 2020-11-28 03:37

    Before it was running on :docker run -d --name oracle -p 1521:1521 -p 5500:5500 qa/oracle I just changed the port to docker run -d --name oracle -p 1522:1522 -p 5500:5500 qa/oracle

    it worked fine for me !

    0 讨论(0)
  • 2020-11-28 03:39

    A variation of @DmitrySandalov's answer: I had tomcat/java running on 8080, which needed to keep going. Looked at the docker-compose.yml file and altered the entry for 8080 to another of my choosing.

    nginx:
      build: nginx
      ports:
        #- '8080:80' <-- original entry
        - '8880:80'
        - '8443:443'
    

    Worked perfectly. (The only wrinkle is the change will be wiped if I ever update the project, since it's coming from an external repo.)

    0 讨论(0)
  • 2020-11-28 03:40

    I had same problem,
    docker-compose down --rmi all (in the same directory where you run docker-compose up)
    helps

    0 讨论(0)
  • 2020-11-28 03:40

    I had the same problem. I fixed this by stopping the Apache2 service on my host.

    0 讨论(0)
  • 2020-11-28 03:40
    `$` sudo service redis-server stop
    

    Does the trick.

    0 讨论(0)
提交回复
热议问题