compose: [BUG] `up` Incorrectly recreates containers with no changes
Description
Since updating to 2.16, docker compose up incorrectly recreates containers when they haven’t changed. This only appears to happen for services that are defined in another file and included with extends.
Steps To Reproduce
- Define a service in a separate YAML file and include the file in
docker-compose.ymlwithextends - Run
docker compose up -dmultiple times - Service will recreate+start each time
Compose Version
Docker Compose version 2.16.0
Docker Environment
No response
Anything else?
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 9
- Comments: 16 (1 by maintainers)
There was a regression in v2.16.0 that’s fixed by #10275 which would cause Compose to keep re-creating containers unnecessarily on
upafter the first time.This will be fixed in the next Compose release.
This happens to me too, without extend, any time a service gets an image update,
docker compose upalways recreate the container even though it’s already running the newest image.One workaround is to manually
docker compose downfirst thendocker compose upagain.It took for ever for 2.17.2 to be available for installation using
apt, but now that it is it solved my issue! Thanks for the great work!Oh, that was my mistake. You are absolutely right, currently version 2.17.0 is only available as a release candidate. I loaded the version automatically via script and had not paid attention to the exact git tag. Sorry for the confusion 😉