我尝试在Ubuntu 18.04上尝试运行docker示例,并遵循以下文档: https://www.learnitguide.net/2018/06/write-dockerfile-to-build-own-images.html
docker run -d -it --name myweb80012 -p 192.168.2.1:8001:8001 myserver_new
但是我收到此错误:
docker: Error response from daemon: driver failed programming external connectivity on endpoint myweb80012 (94a73a664dd3b9c9dc59b750e70d157568f4d4551f733c29d5f86c7e0db287b8): Error starting userland proxy: listen tcp 192.168.2.1:8001: bind: cannot assign requested address.
我的Docker版本
# docker -v
Docker version 18.09.0, build 4d60db4
#sudo docker version
Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:49:01 2018
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:16:44 2018
OS/Arch: linux/amd64
Experimental: false
如何解决此问题?
答案 0 :(得分:0)
您正在尝试绑定到主机上任何接口上都不存在的IP地址。从发布端口中删除IP地址,或者使用主机上存在的IP地址:
docker run -d -it --name myweb80012 -p 8001:8001 myserver_new
或诸如回送之类的东西:
docker run -d -it --name myweb80012 -p 127.0.0.1:8001:8001 myserver_new