I have a 2 node swarm cluster configured as follows
I have configured Google Container Registry to push and pull images
In the host/local machine where docker swarm configured I can easily login into the google container registry with following command and push/pull images
$ gcloud auth print-access-token | sudo docker login -u oauth2accesstoken --password-stdin https://gcr.io
WARNING: Could not setup log file in /home/arush/.config/gcloud/logs, (PermissionError: [Errno 13] Permission denied: '/home/arush/.config/gcloud/logs/2021.03.09/15.17.13.106143.log')
WARNING! Your password will be stored unencrypted in /home/arush/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
To login I am using Access token method as mentioned here
Now If I try to create service inside swarm on manager node with following command I get message like image not found
$ docker service create --name app1 --with-registry-auth -p 5003:5000 app1
How can I login in google container registry from within the swarm cluster pull images and create services
