从私有注册表中提取映像时,docker swarm创建服务失败 [英] docker swarm create service failed when pull images from private registry

查看:136
本文介绍了从私有注册表中提取映像时,docker swarm创建服务失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为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.

  1. 如果您未登录到私人注册表,请进行身份验证 (docker login ..)
  2. 创建您的服务: docker service create --with-registry-auth --name my-service my_repo/image:latest
  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

这篇关于从私有注册表中提取映像时,docker swarm创建服务失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆