I have a private docker registry, and when I pull images from it everything is OK But when I want to start a docker swarm service:
docker service create --name myredis --network mynetwork --replicas 1 -p 6379:6379 myregistry:8082/redis
, it shows me next error
unable to pin image myregistry:8082/redis to digest: Head http://myregistry:8082/v2/redis/manifests/latest: no basic auth credentials
How can I use my local registry while creating docker swarm services?
Add --with-registry-auth to your docker stack deploy or docker service create commands. In a swarm, your host is logged in (so you can pull and run) but your workers are not. This passes the login token from your local client to the swarm nodes where the service is deployed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With