从私有注册表中提取映像时,docker swarm创建服务失败 [英] docker swarm create service failed when pull images from private registry
问题描述
作为docker初学者,我在5台Linux服务器上构建了一个群集集群. (docker版本17.12.0-ce)
As a docker beginner, I have built a swarm cluster on 5 Linux server. (docker version 17.12.0-ce)
但是当我创建服务时,我看到docker service ps
命令显示"pulling image failed" error="pull access denied for registry.xxxx.xxx
.
But when I create a service, I see docker service ps
command shows "pulling image failed" error="pull access denied for registry.xxxx.xxx
.
我正在使用一个私有注册表,该注册表首先应使用docker login
.
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 ?
推荐答案
您需要在docker service create
上传递--with-registry-auth
标志以传递您的凭据.
You need to pass the --with-registry-auth
flag on docker service create
to pass your credentials.
- 如果您未登录到私人注册表,请进行身份验证
(
docker login ..
) - 创建您的服务:
docker service create --with-registry-auth --name my-service my_repo/image:latest
- Authenticate if you're not logged in to your private registry
(
docker login ..
) - Create your service:
docker service create --with-registry-auth --name my-service my_repo/image:latest
这篇关于从私有注册表中提取映像时,docker swarm创建服务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!