Docker swarm service port not exposed

我的梦境 提交于 2020-01-06 08:59:18

问题


I cannot connect to a service running on docker swarm. The swarm seems ok because I can connect to other containers running on it. I running the service with docker stack deploy -c docker-compose.yaml nifi and the docker compose file is:

version: "3.3"
services:
  registry:
    image: apache/nifi-registry:0.3.0
    ports:
      - "18080:18080"
  deploy:
    replicas: 1
    restart_policy:
      condition: on-failure

When I run this without the swarm i.e. docker-compose -f docker-compose.yaml up it works fine and I can browse to it. When I run it with docker stack deploy -c docker-compose.yaml nifi I see the same log entries for the service but cannot browse to it.

$ docker version

Client:
  Version:      18.03.1-ce
  API version:  1.37
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Wed Jun 20 21:43:51 2018
  OS/Arch:      linux/amd64
  Experimental: false
  Orchestrator: swarm

Server:
  Engine:
    Version:      18.03.1-ce
    API version:  1.37 (minimum version 1.12)
    Go version:   go1.9.5
    Git commit:   9ee9f40
    Built:        Wed Jun 20 21:42:00 2018
    OS/Arch:      linux/amd64
    Experimental: false

Does anyone have suggestions for fixing or troubleshooting this?

来源:https://stackoverflow.com/questions/54121566/docker-swarm-service-port-not-exposed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!