4km3/docker-dnsmasq

Don't work in swarm but in docker-compose

Closed this issue · 4 comments

When I start docker-compose up -d the DNS works well and I can resolve names from other servers but when I start the compose in swarm mode with docker stack deploy -c docker-compose.yml dns the DNS won't work.

In both cases the docker-compose.yml looks like this:

version: '3.8'
services:
dns:
restart: always
image: andyshinn/dnsmasq:2.81
volumes:
- ./dnsmasq.conf:/etc/dnsmasq.conf
ports:
- "53:53/tcp"
- "53:53/udp"
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.id==o87t6ftvgb76t6iu7z

Can you show the commands how your are testing and the error vs expected results? Is it the same host?

Sure :)
Docker Compose (working):
start the compose with docker-compose up -d
Host output:
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use docker stack deploy.

Creating network "dns_default" with the default driver
Creating dns_dns_1 ... done

At this moment I can set the DNS on another server an everything run perfectly!

Starting in swarm mode on same server (not working):
docker stack deploy -c docker-compose.yml dns
Host output:
Ignoring unsupported options: restart

Creating network dns_default
Creating service dns_dns

I don't get an error when starting the service in swarm mode but a DNS resolve isn't possible.

I think this would be a good problem to post on Stack Overflow or Super User. I'm not sure it is related to this image. Can you try those resources?

I'm gonna close this now.