我正在使用以下命令将一些映像从我的注册表部署到我的应用程序服务器中docker swarm 模式主机t :
我在注册表中的图像看起来像这样(执行docker images
) :
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost:5000/myApp G02R00C09_myTag c1fc2242f9a0 2 hours ago 272MB
Under 我的 docker 撰写文件,我的服务如下所示:
---
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
:
我的堆栈和服务运行良好(当我运行时docker stack ls
and docker service ls
, 一切都好)
->但跑步时docker images
,我确实明白了我的形象but with <none>
tag:
image: myRegistryServer:5000/myApp <none>
这个是正常的。使用 Swarm Stacks 时,它将您的标签转换为该图像的 SHA256 并下载该特定 ID。这保证了每个节点都有相同的图像。如果它仅依赖于标签,您可以在docker push
,并且不同的节点可以下载不同的图像。
您可以看到在 a 中使用的标签docker service ls
or docker stack ps <stackname>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)