【问题标题】:Docker stack deploy is not updating existing containersDocker 堆栈部署未更新现有容器
【发布时间】:2020-05-27 17:46:32
【问题描述】:

我正在使用docker stack deploy 部署 4 个容器,如下所示:

docker stack deploy --compose-file compose.yml --with-registry-auth myapp

第一次使用registry上的最新镜像构建容器,没问题。

但是当我将新图像推送到注册表并再次运行命令时,容器不会使用最新图像重建。

我在我的图片中使用了latest 标签。我知道这不是推荐的做事方式,但对于我在文档中阅读的内容,docker stack deploy 如果使用latest 标记,将使用注册表检查图像 sha,如果不同,容器将重建使用最新的图像,但在我的情况下,它没有发生。我在这里遗漏了什么吗?

一旦堆栈已经启动,我在运行docker stack deploy 时也会收到错误/警告:

Updating service service_name (id: some_hash_value)
image docker.pkg.github.com/username/repository/image-name:latest could not be accessed on a registry to record
its digest. Each node will access docker.pkg.github.com/username/repository/image-name:latest independently,
possibly leading to different nodes running different
versions of the image.

【问题讨论】:

标签: docker docker-compose docker-swarm


【解决方案1】:

当我开始使用新的 docker 注册表时,我遇到了同样的错误消息。新注册中心的 SSL 证书未被 docker 视为安全。

所以在我将新注册表添加到 /etc/docker/daemon.jsoninsecure-registries 部分之前,我遇到了这个错误

我看到没有人在这个问题或其他类似问题上提到这个解决方案,所以我希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2017-08-05
    • 1970-01-01
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 2020-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多