compose: recreate container when mounted image digest changes by ibrahimypr · Pull Request #13549 · docker/compose

ndeloof

ndeloof

ndeloof

ndeloof

ndeloof previously approved these changes Jan 26, 2026

ndeloof

@ibrahimypr

Until now, mustRecreate logic only checked for divergence in TypeVolume
mounts but ignored TypeImage mounts. This inconsistency caused containers
to erroneously retain stale images even after the source image was rebuilt.
This commit updates ensureImagesExists to resolve image volume sources to
their digests using the official reference package. This enables ServiceHash
(config hash) to naturally detect underlying image digest changes,
triggering recreation via the standard convergence logic.
An E2E test case is added to verify this behavior.
Fixes docker#13547

Signed-off-by: ibrahim yapar <74625807+ibrahimypr@users.noreply.github.com>

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Feb 25, 2026

@tmeijn