docker – 继续使用:Stack服务器无休止地加载页面

前端之家收集整理的这篇文章主要介绍了docker – 继续使用:Stack服务器无休止地加载页面前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我一直非常密切关注docker get started guide – 除了我的python应用程序中的一些更改,我已经确认这些更改从我推送到docker hub的版本没有问题.

但是,当我到达第3部分并尝试加载localhost:80时,页面只是无休止地加载.

我的命令:

  1. $docker swarm init
  2. Swarm initiated: ...
  3. $docker stack deploy -c docker-compose.yml
  4. Creating network getstartedlab_webnet
  5. Creating service getstartedlab_web
  6. $docker stack ps getstartedlab
  7. ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
  8. fhxqr2u8hxar getstartedlab_web.1 mctague/friendlyhello:2 cube Running Running 29 seconds ago
  9. 4t9mu9r8147e getstartedlab_web.2 mctague/friendlyhello:2 cube Running Running 28 seconds ago
  10. duute2pvgu9z getstartedlab_web.3 mctague/friendlyhello:2 cube Running Running 30 seconds ago
  11. 9kav6v27qfjn getstartedlab_web.4 mctague/friendlyhello:2 cube Running Running 29 seconds ago
  12. 1s2imbiuk6e2 getstartedlab_web.5 mctague/friendlyhello:2 cube Running Running 29 seconds ago
  13. $docker logs

泊坞窗,compose.yml

  1. version: "3"
  2. services:
  3. web:
  4. image: mctague/friendlyhello:2
  5. deploy:
  6. replicas: 5
  7. resources:
  8. limits:
  9. cpus: "0.1"
  10. memory: 50M
  11. restart_policy:
  12. condition: on-failure
  13. ports:
  14. - "80:80"
  15. networks:
  16. - webnet
  17. networks:
  18. webnet:
最佳答案
在某些系统中,curl默认为localhost连接到ip6.所以你可以运行curl:

  1. $curl 127.0.0.1:80

要么

  1. $curl -4 localhost:80

猜你在找的Docker相关文章