我做的是搬运工入门指南:https://docs.docker.com/get-started/part3/#recap-and-cheat-sheet-optional可以从卷曲访问搬运工服务而不是从邮递员/铬
泊坞窗,compose.yml:
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: username/repo:tag
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "80:80"
networks:
- webnet
networks:
webnet:
我通过部署我的应用程序运行docker stack deploy -c docker-compose.yml getstartedlab
。 然后从卷曲访问我的服务,它做工精细curl -4 http://localhost
<h3>Hello World!</h3><b>Hostname:</b> 1532cae6e06f<br/>....
但是,要http://localhost:80
(它加载永远)我无法从Chrome或邮递员访问它。为什么以及如何修复它?
更新19/10/17:
我可以访问我的服务在浏览器中:http://192.168.1.68:80
。 这是领导节点的地址(这是我的真机的IP也..)。
但为什么我不能做到这一点从本地主机也?
你运行邮递员为卷曲? – frennky
是.............. –