docker swarm create service failed when pull images from private registry

依然范特西╮ 提交于 2019-12-11 17:54:16

问题


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 ?


回答1:


You need to pass the --with-registry-auth flag on docker service create to pass your credentials.

  1. Authenticate if you're not logged in to your private registry (docker login ..)
  2. Create your service: docker service create --with-registry-auth --name my-service my_repo/image:latest


来源:https://stackoverflow.com/questions/49086172/docker-swarm-create-service-failed-when-pull-images-from-private-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!