Docker service create cannot find image

When I start the docker service, create -mode global foo myrepo / foo-img: 0.1, it works in that it starts the service, but if foo-img: 0.1 does not exist on the node in the swarm, that node emits the following error:

<containerid> \_ foo myrepo/foo:0.1 <snip> "No such image: myrepo/foo-img:0.1" 

If I pulled myrepo / foo-img: 0.1 onto each node, then it works fine.

Is there a workaround for this other than pulling an image on each node in the swarm?

+5
source share
1 answer

The answer is actually quite simple. Use the --with-registry-auth option. This option uses the same authentication that is used for the current session. So, to make this work simple:

 # docker login -u xxx -pass yyy https://myrepo.com # service create --with-registry-auth foo myrepo.com/foo-img:0.1 

Assuming you have successfully logged in, the service will pull the image from the repo to each node as needed. Not sure exactly what is going on behind the scenes, but it works to deploy to all the nodes currently in the cluster! Thanks to the help of people at github / docker!

+4
source

All Articles