docker: driver failed programming external connectivity on endpoint webserver

后端 未结 12 1894
陌清茗
陌清茗 2020-12-23 19:16

I am trying to run a docker example following this documentation

This is my command:

docker run -d -p 80:80 --name webserver nginx
<
相关标签:
12条回答
  • 2020-12-23 19:36

    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

     sudo service docker stop
     sudo rm /var/lib/docker/network/files/local-kv.db
     sudo service docker start
    
    0 讨论(0)
  • 2020-12-23 19:36

    Try this command:

    sudo service docker restart
    

    If it does not help, restart your server.

    0 讨论(0)
  • 2020-12-23 19:38

    Check what's on port 80 right now - sudo ss -tulpn | grep :80

    You may have apache2 running. You can check it - sudo service apache2 status If so - sudo service apache2 statop

    0 讨论(0)
  • Stop all the running containers docker ps -a -q then Stop the Docker on your machine & restart it.

    0 讨论(0)
  • 2020-12-23 19:42

    windows users: docker description

    On Windows systems, CTRL+C does not stop the container. So, first type CTRL+C to get the prompt back (or open another shell), then type docker container ls to list the running containers, followed by docker container stop to stop the container. Otherwise, you get an error response from the daemon when you try to re-run the container in the next step.

    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:

    docker container ls #list containers running
    docker stop [container id] #replace [container id] with the container id running
    
    0 讨论(0)
  • 2020-12-23 19:46

    Try restarting the docker service. It works 99% of the time.

    service docker restart
    

    If that didn't work as expected, try restarting your pc and then restarting the docker service using above command.

    If none of the above worked try changing the exposed port to another unused port that should work.

    docker run -d -p 81:80 --name webserver nginx
    
    0 讨论(0)
提交回复
热议问题