I initialized a docker swarm have have 3 nodes in it.
Then I add an overlay with
docker network create --driver overlay pica_net
and then I want to deploy the following service with 3 tasks
services:
nacos:
image: nacos:latest
networks:
pica_net:
deploy:
mode: replicated
replicas: 3
volumes:
- /opt/logs/nacos:/app/logs
networks:
pica_net:
I started it with
docker stack deploy -c docker-compose.yml nacos-stack
but I see the process is:
Creating network nacos-stack_pica_net
Creating service nacos-stack_nacos
I am wondering why doesn’t these three containers join the overlay network pica_net directly, instead docker creates a new overlay network nacos-stack_pica_net, what is wrong?