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:
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:
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.
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"
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.
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"
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
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.