简体   繁体   English

Docker 群找不到图像

[英]Docker swarm cannot find image

I deploy a docker swarm with 6 nodes.我部署了一个带有 6 个节点的 docker 群。 I built some images and I am trying to add them as services to the swarm.我构建了一些图像,并试图将它们作为服务添加到群中。 I have 5 microservices.我有 5 个微服务。 When I run the on one host with docker-compose everything works fine.当我使用 docker-compose 在一台主机上运行时,一切正常。 I run this command docker service create rate --with-registry-auth and I get the following message.我运行此命令 docker service create rate --with-registry-auth 并收到以下消息。

image rate:latest could not be accessed on a registry to record
its digest. Each node will access rate:latest independently,
possibly leading to different nodes running different
versions of the image.

yyf9m49xw3enwano1scr55ufc
overall progress: 0 out of 1 tasks 
1/1: No such image: rate:latest 

I run docker images and the rate image is appeared.我运行 docker 图像并出现速率图像。 rate is the repository name. rate 是存储库名称。 I also tried with the image id but didn't worked.我也尝试使用图像 ID 但没有用。 The only images that I can add to swarm is images that is public.我可以添加到 swarm 的唯一图像是公开的图像。

image rate:latest could not be accessed on a registry to record
its digest. Each node will access rate:latest independently,
possibly leading to different nodes running different
versions of the image.

This error indicates you are trying to run an image that was never pushed to a registry.此错误表明您正在尝试运行从未推送到注册表的映像。 Push your images to a registry first.首先将您的图像推送到注册表。 And then you can run them on any node in the cluster (which will pull any missing images from that registry).然后您可以在集群中的任何节点上运行它们(这将从该注册表中提取任何丢失的图像)。 If the registry requires authentication to pull the image, then run docker stack deploy --with-registry-auth... , but you must first push the image, and specific the pushed image name (which will not be rate:latest since you do not have access to push to the official library on Docker Hub).如果 registry 需要身份验证才能拉取镜像,那么运行docker stack deploy --with-registry-auth... ,但是你必须先推送镜像,并指定推送的镜像名称(这不会是rate:latest因为你没有权限推送到 Docker Hub 上的官方库)。

There is an issue ( https://github.com/moby/moby/issues/35187 ) on the Moby project about that. Moby 项目中有一个问题 ( https://github.com/moby/moby/issues/35187 )。

If you tried already to set --with-registry-auth but didn't solved it, you should manually login to each cluster worker node and pull the Docker images.如果您已经尝试设置 --with-registry-auth 但没有解决它,您应该手动登录到每个集群工作节点并拉取 Docker 图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM