I am on Mac. Trying to run a docker example Following this documentation: https://docs.docker.com/docker-for-mac/ This is my command:
docker run -d -p 80:80 --name webserver nginx
But i am getting this error:
docker: Error response from daemon: driver failed programming external connectivity on endpoint webserver (bd57efb73c738e3b271db180ffbee0a56cae86c8193242fbc02ea805101df21e): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE).
Need help.
windows users: docker description
I had the same problem, I thought with CTRL+C stoped the container but it was not the case, any af the answer above works because they all stop containers, restarting docker or stoping container explicity.
I prefer:
From your error message, the
EADDRINUSE
indicates port 80 is already in use on either the docker VM or possibly directly on your laptop. You can either stop whatever is running on that port, or change the port used in your Docker, command. To change to the external port 8080, use:Recently this problem started to happen a lot on Windows. You can try restarting docker or you can manually stop docker before Windows shutdown - docker starts cleanly on reboot. On 7/24/2018 docker issue is open and further details can be found at https://github.com/docker/for-win/issues/1967
Try restarting docker. That usually works for me.
I had the same issue with one of my containers. I tried everything but when nothing worked, I tried the following and launched the container again with success