加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 03:27:48 所属栏目:安全 来源:网络整理
导读:我一直非常密切关注docker get started guide 除了我的python应用程序中的一些更改,我已经确认这些更改从我推送到docker hub的版本没有问题. 但是,当我到达第3部分并尝试加载localhost:80时,页面只是无休止地加载. 我的命令: $docker swarm initSwarm init

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

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

我的命令:

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

泊坞窗,compose.yml

version: "3"
services:
  web:
    image: mctague/friendlyhello:2
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks:
      - webnet
networks:
  webnet:
最佳答案
在某些系统中,curl默认为localhost连接到ip6.所以你可以运行curl:

$curl 127.0.0.1:80

要么

$curl -4 localhost:80

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读