Docker Swarm:docker 在未标记图像上堆栈部署结果 <none>

Docker Swarm : docker stack deploy results on untagged images <none>

我正在使用 docker swarm mode host :

将我的注册表中的一些图像部署到我的应用程序服务器中

我在注册表中的图像看起来像这样(执行 docker images):

REPOSITORY                                                 TAG                   IMAGE ID            CREATED            SIZE
localhost:5000/myApp                                       G02R00C09_myTag   c1fc2242f9a0        2 hours ago         272MB

my docker compose file 下,我的服务如下所示:

---
version: '3.4'
services:
  ihm:
    image: myRegistryServer:5000/myApp:G02R00C09_myTag   
    stdin_open: true
    volumes:
    - /opt/logs:/opt/logs
    tty: true
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
    deploy:
      mode: global
      placement:
        constraints:
          - node.labels.type == abc
    healthcheck:
      disable: true

-> 执行后 docker stack deploy :

我得到了我的堆栈和我的服务 运行ning(当我 运行 docker stack lsdocker service ls 时,一切正常)

-> 但是当 运行ning docker images 时,我确实得到了我的图像 但是 <none> 标签:

image:  myRegistryServer:5000/myApp      <none> 

这是正常的。使用 Swarm Stacks 时,它会将您的标签转换为该图像的 SHA256 并下载该特定 ID。这保证了每个节点都具有相同的图像。如果它只依赖于标签,您可能会在 docker push 中重复使用标签,并且不同的节点可能会下载不同的图像。

您可以看到 docker service lsdocker stack ps <stackname>

中使用的标签