Docker Error bind: address already in use

后端 未结 20 1254
情深已故
情深已故 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:53

    The one that was using the port 8888 was Jupiter and I had to change the configuration file of Jupiter notebook to run on another port.

    to list who is using that specific port. sudo lsof -i -P -n | grep 9

    You can specify the port you want Jupyter to run uncommenting/editing the following line in ~/.jupyter/jupyter_notebook_config.py:

    c.NotebookApp.port = 9999

    In case you don't have a jupyter_notebook_config.py try running jupyter notebook --generate-config. See this for further details on Jupyter configuration.

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

    Changing network_mode: "bridge" to "host" did it for me.

    This with

    version: '2.2'
    services:
      bind:
        image: sameersbn/bind:latest
        dns: 127.0.0.1
        ports:
          - 172.17.42.1:53:53/udp
          - 172.17.42.1:10000:10000
        volumes:
            - "/srv/docker/bind:/data"
        environment:
          - 'ROOT_PASSWORD=secret'
        network_mode: "host"
    
    0 讨论(0)
  • 2020-11-28 03:56

    On my machine a PID was not being shown from this command netstat -tulpn for the in-use port (8080), so i could not kill it, killing the containers and restarting the computer did not work. So service docker restart command restarted docker for me (ubuntu) and the port was no longer in use and i am a happy chap and off to lunch.

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

    Check docker-compose.yml, it might be the case that the port is specified twice.

    version: '3'
    services:
      registry:
        image: mysql:5.7
            ports:
          - "3306:3306"             <--- remove either this line or next
          - "127.0.0.1:3306:3306"
    
    0 讨论(0)
  • 2020-11-28 03:57

    I was getting the below error when i was trying to launch a new conatier- listen tcp 0.0.0.0:8080: bind: address already in use.

    Solution: netstat -tulnp | grep 8080

    [root@ip-112-x6x-2x-xxx.xxxxx.compute.internal (aws_main) ~]# netstat -tulnp | grep 8080 tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 12749/java [root@ip-112-x6x-2x-xxx.xxxxx.compute.internal (aws_main) ~]#

    kill -9 12749

    Then try to relaunch the container it should work

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

    Just a side note if you have the same issue and is with Windows:

    In my case the process in my way is just grafana-server.exe. Because I first downloaded the binary version and double click the executable, and it now starts as a service by user SYSTEM which I cannot taskkill (no permission)

    I have to go to "Service manager" of Windows and search for service "Grafana", and stop it. After that port 3000 is no longer occupied.

    Hope that helps.

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