我一直在關注的docker get started guide頗有淵源 - 除了在我的Python應用程序的幾個變化,我已確認是沒有問題從版本的工作我都推到泊塢窗樞紐。繼上手:堆棧服務器卡住加載頁面不休
然而,當我拿到第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 <one of the running containers>
* Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
$ curl localhost:80
< either an endless loading that I have to cancel with ^C,
*OR* Connection refused >
泊塢窗,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:
你有沒有嘗試過簡單的例子?嘗試只部署1個副本,給它多一點資源並在沒有重啓策略的情況下啓動它(一個可能的錯誤源)。 – Gabbax0r
@ Gabbax0r仍然表現完全一樣,無論是無限加載還是完全不加載 –
您正在運行什麼應用程序?不能確定你有'mctague/friendlyhello'的圖片名稱。你還可以分享你的Dockerfile的內容嗎? – JulioHM