Repository navigation
Warn when a destination's compose recreates unchanged containers - #38
Merged
Merged
Conversation
compose before 5.5.0 decides a container is stale by its image id, and buildkit's provenance attestation gives every build a new one under the containerd image store, so redeploying a commit restarted services that had not changed. compose 5.5.0 compares the image's content instead. Preflight now reads the destination's compose version and warns below 5.5.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before compose 5.5.0, compose decided whether a container was stale by its image id. BuildKit attaches a provenance attestation with a build time to every image, so under the containerd image store every rebuild gets a new id, and redeploying a commit recreated every container in place even when nothing changed. compose 5.5.0 (docker/compose#14011, docker/compose#14041) compares the image's content instead.
Preflight now reads
docker compose version --shorton the destination and warns below 5.5.0, naming the host and the version. An unreadable version gives no warning. The README lists compose 5.5.0 as the server requirement.Found on a destination running compose 5.0.0: a same-commit redeploy restarted every service. After upgrading it to 5.6.1, a throwaway project built on that destination kept its containers across a same-commit redeploy while provenance stayed attached, and a real change still cut over normally.
Tested: unit tests for version parsing (v-prefix, build suffixes, unreadable versions) and for reading it from the destination; full suite passes.