docker - 即使使用 --with-registry-auth,Docker 堆栈部署也不会从私有 resgistry 中提取图像
问题描述
我正在使用以下命令使用 docker stack 和 docker-compose 文件部署容器
docker stack deploy --with-registry-auth -c compose.yml app
初始部署成功,但是当我重新运行命令时,容器出现以下错误:
Updating service sparkful_nginx (id: <some_id>)
image <image_url> could not be accessed on a registry to record
its digest. Each node will access <image_url> independently,
possibly leading to different nodes running different
versions of the image.
PS:我正在使用 GitHub 注册表。
解决方案
您可能需要在每台机器上执行 docker login,然后
docker login -u username -p password registry.hub.Docker.com/myproject
docker stack deploy -c Docker-swarm.yml test --with-registry-auth
正如这里所解释的
参考: http: //littlebigextra.com/installing-docker-images-private-repositories-docker-swarm/
使用 Github Registry 进行更新 ,目前这是一个已知问题。 https://github.com/containerd/containerd/issues/3291#issuecomment-579804848
推荐阅读
- sql - 在代码中没有提到其他数据库的情况下触发从其他数据库获取数据?如何?
- flutter - 如何在颤动中从 JSON 对象中提取键和值
- terraform - 使用 terraform 为现有虚拟机启用 Azure Monitor
- powershell - 加速Powershell
- r - 转换数据框中的原始向量列表
- node.js - 在 AWS lambda 上设置 https 代码使用 NodeJS
- python - PDF python文本编码错误
- reactjs - Firebase - set() 不会更改值,而是创建新文档
- python - 如何根据 Python 中另一个列表的(子列表)索引对列表进行分区
- python - python请求403禁止,但它与charles一起使用