Docker Error response from daemon: driver failed programming external connectivity on endpoint webserver

时间:2024-10-23 10:07:32

按照官网的配置,

https://docs.docker.com/docker-for-windows/

当执行到第 5 步时

Docker  Error response from daemon: driver failed programming external connectivity on endpoint webserver

如果当前你的电脑 80 端口已经被别的程序占用,运行以上命令就会报错,报错如下:

Docker  Error response from daemon: driver failed programming external connectivity on endpoint webserver

报错信息显示有冲突

解决方法:

可以通过改变端口号解决,例如修改为 8080

docker run -d -p : --name webserver nginx

运行成功在浏览器打开 localhost:8080 :

Docker  Error response from daemon: driver failed programming external connectivity on endpoint webserver