0

I setup the Docker Swarm cluster with one manager node and 2 worker nodes:

    swarm-admin@node-1:~$ docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
de4zdkoxazsjqch5tczk5czqo *   node-1        Ready               Active              Leader              19.03.12
lhxspp75cqve5hq99gxcjs0hz     node-2        Ready               Active                                  19.03.12
mgcoy9sk2apa6p0ah6gmekk99     node-3        Ready               Active                                  19.03.12

and try to deploy a stack with docker compose:

version: '3'
services:
    tests:
        image: myrepo/image
        ports:
          - "80:80"
          - "443:443"

but the stack only deploy on the master node only, it is trying to deploy to others node, but it face "Reject" and then deploy to manager node successfully. I use below command to run a stack:

docker stack deploy -c docker-compose.yml test-stack

Can anybody support me?

1 Answer 1

1

Try this

docker stack deploy -c docker-compose.yml test-stack --with-registry-auth
Sign up to request clarification or add additional context in comments.

2 Comments

yep, it works! how can I set --with-registry-auth out of the command?
When you deploy across swarm you need to set that flag. You can't set out that command. If my answer correct can you set it as correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.