As a docker beginner, I have built a swarm cluster on 5 Linux server. (docker version 17.12.0-ce)
But when I create a service, I see docker service ps
command shows "pulling image failed" error="pull access denied for registry.xxxx.xxx
.
I'm using a private registry which should be use docker login
at first.
So, how to do the login action when creating a swarm service ?
You need to pass the
--with-registry-auth
flag ondocker service create
to pass your credentials.docker login ..
)docker service create --with-registry-auth --name my-service my_repo/image:latest