我跑:
docker run -p "9999:80" nginx
并尝试使用以下地址访问web服务器:
172.17.0.2:9999
docker inspect [container_id]
"NetworkSettings": {
"Bridge": "",
"SandboxID": "877eb750a0f35037f0b9dff2b6bd95f7dd4aaf80ae0ed8cf65e20ad8aeb85132",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "9999"
}
]
},
"SandboxKey": "/var/run/docker/netns/877eb750a0f3",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "2599dc8c2311725e9816fc30e60a86550cb42887871a921365e3df866427464e",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "ffc037f862047b118824b8d322aab771ba75a009881959461be577ffebb42a80",
"EndpointID": "2599dc8c2311725e9816fc30e60a86550cb42887871a921365e3df866427464e",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
但这并不像预期的那样有效。如果我是平
172.17.0.2
从主人那里我没有得到回应。
有什么问题吗?这太麻烦了
docker-toolbox
因为docker不支持我的Windows10版本。