问题
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