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

Viewed 5864

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?

2 Answers

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

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.

Related