I am unable to run official nifi image in docker swarm. When I start container in regular mode:
docker run --name nifi -p 8080:8080 -d apache/nifi:latest
everything works fine and I can access the application under http://localhost:8080/nifi
However when i try to run application in docker swarm:
docker swarm init
docker stack deploy -c docker-compose.yml nifi
With the following docker-compose.yml
version: "3"
services:
zookeeper:
hostname: zookeeper
container_name: zookeeper
image: 'bitnami/zookeeper:latest'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
nifi:
image: apache/nifi:latest
ports:
- "8080:8080"
expose:
- "8080"
environment:
- NIFI_WEB_HTTP_PORT=8080
- NIFI_WEB_HTTP_HOST=localhost
- NIFI_CLUSTER_IS_NODE=true
- NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
- NIFI_ZK_CONNECT_STRING=zookeeper:2181
- NIFI_ELECTION_MAX_WAIT=1 min
Application starts (zookeeper and nifi) but is unaccessible under http://localhost:8080/nifi
curl http://localhost:8080
curl: (52) Empty reply from server
However running the following code:
docker exec -it 629ecd6949d9 curl -v http://localhost:8080
shows that nifi is up and running, but for some reason it does not work from outside container.
I am close to start hitting the wall with my head. How can I fix this?
Best Paweł

