Docker развертывание стека без обновления контейнеров с последними - PullRequest
1 голос
/ 06 марта 2020

Я прочитал это: Повторное развертывание docker стек не обновляет контейнеры с последней и, как говорится в этой проблеме:

But I still want to use latest anyway, and have swarm check for latest sha digest (or any tag that I reuse every deploy)
Turns out this should work as of 17.06 out of the box. docker stack deploy should pull sha digests from the registry each time. This changed a bit since then, and bugs were fixed, so this is where we're at today:

docker stack deploy -c stack.yml mystack with a 18.06 client and server versions, will turn the latest tag (or lack of tag) in the stack.yml into a sha and send that to the service update command. If the sha digests match, and nothing else in yaml has changed, service will not replace the task.

Stack deploy now has docker stack deploy --resolve-image options, which defaults to always so it should always check the sha digest. never means it will not compare digests from registery or local cash (even if the node image cache has a different version). I can't figure out what changed does.

Но почему мой тест все равно не удался:

Я обновляю свой образ (все еще использую последний тег) и выполняю docker stack deploy -c test.yml test, но моя служба не перезапустилась, чтобы использовать новый образ для запуска контейнера.

Неужели я неправильно понял проблему?

Это test.yml:

version: "3.7"
services:
        testapp:
                image: testimage

Это docker версия:

docker-ce-cli-19.03.5-3.el7.x86_64
docker-ce-19.03.5-3.el7.x86_64

...