docker-pr proc already listening on port 80? Installed docker with snappy on Ubuntu
Asked Answered
S

2

15

I ran this:

docker run -ti -p 80:80 --name esproxy "$tag"

but I get this error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint esproxy (ead1fa4f09b2326cd1ff6aa0e3b8f8bfa5c9d353eb6db4efef6d188b81ea9df7): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use.

So I did:

root@ip-172-xx-29-110:/interos/repos/nginx# lsof -i:80

and I got:

COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 28213 root    4u  IPv6  64253      0t0  TCP *:http (LISTEN)

and so this process looks like:

root     28213  0.0  0.0 116552  2620 ?        Sl   04:34   0:00 /snap/docker/384/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.17.0.2 -container-port 80

does anybody know what that process is?

Sewerage answered 12/6, 2019 at 18:30 Comment(1)
Note that docker-pr is just docker-proxy truncated in the output.Cantrell
D
14

I had the same issue.

Stoppping all runing containers and restarting the docker service fixed it for me

service docker restart

and then start your container again

Dialectics answered 6/3, 2020 at 20:7 Comment(0)
S
5

If after you restart the docker service, the docker-pr service allocates some container port, your container is starting automatically.

To check if you have some container running use:

docker ps

To stop this container, we can use:

docker stop container_name

If you have more than one container, we can use:

docker stop $(docker ps -a -q)

To stop a container from starting automatically, we need to remove it from the auto restart.

To do this use the following command:

docker update --restart=no container_name

After this, you will able to restart your docker service and you will not found any container starting automatically.

Seeger answered 9/3, 2021 at 12:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.