docker stack deploy from compose file - all servic

2019-08-17 22:43发布

I have a docker-compose file with 10 services (containers). I have it configured one instance of each server.

When I execute the stack deploy, all 10 services go to one node (manager).

I trust that adding a second instance of a service will distribute it, but I want my 10 unique services distributed.

2条回答
姐就是有狂的资本
2楼-- · 2019-08-17 22:58

If you are using a private registry its important to share the login and credentials with the worker nodes by using

docker stack deploy --with-registry-auth
查看更多
干净又极端
3楼-- · 2019-08-17 23:06

Don't have the reputation to comment but...

If you are using a private registry that requires a ca certificate --with-registry-auth alone doesn't seem to work. You need to install the ca certificate to each node.

We are using Harbor but I guess that's not that relevant.

In my case I had to do something like:

sudo mkdir -p /etc/docker/certs.d/10.10.1.5
sudo cp ca.crt /etc/docker/certs.d/10.10.1.5/.

It's really quite obvious but I spent quite some time on this and decided to share.

查看更多
登录 后发表回答