I create a general user, let’s say swarm-user, on each node of swarm cluster. let’s assume user id of swarm-user on node1 is uid1, on node2 is uid2.
test docker-compose.yml is blow:
then I run
userid=$(id -u swarm-user) sudo docker stack deploy -c docker-compose.yml mysql
but it turns out that in mysql task machine, this docker’s process user is not swarm-user.
what happened? how do I set userid dynamically when deploy stack?