-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] up
Incorrectly recreates containers with no changes
#10259
Comments
This happens to me too, without extend, any time a service gets an image update, One workaround is to manually |
An easy way to reproduct this issue version: '3.8'
services:
foo:
environment:
- name=value
image: ubuntu
command: tail -f /dev/null run version: '3.8'
services:
foo:
environment:
- name=xxxxxxxxxx
image: ubuntu
command: tail -f /dev/null after then no metter how many times you run '2.16.0' has this problem Hope the core developers could notice this issue. |
I can confirm the bug. On multiple systems, the containers are restarted on each docker composer up if a new image update was previously downloaded. |
Ah! This must be the real bug then, not |
I can confirm this bug for 2.16, too: "docker compose up -d" recreates all containers always. I do not use extends. |
There was a regression in v2.16.0 that's fixed by #10275 which would cause Compose to keep re-creating containers unnecessarily on This will be fixed in the next Compose release. |
thanks! |
Hi I'm having a similar issue but I'm unsure if the fix will work or not.. And docker compose seems to recreate my containers for ever if it detects a change once...
Just a theory is the hash only updated on the initial docker compose start? (where is the hash stored?) |
@AnderssonPeter Please retry with docker compose version 2.17.0 |
@KeldorDE sorry for my ignorance but how do I install |
There is nothing wrong with that, it seems that the new compose version is not yet available in the distribution you are using. I use the manual installation of docker compose, if you want to use it too, you can find the instructions here https://docs.docker.com/compose/install/linux/#install-the-plugin-manually |
@KeldorDE Correct me if I'm wrong, but it seems to me that |
Oh, that was my mistake. You are absolutely right, currently version 2.17.0 is only available as a release candidate. |
I can confirm this bug as well! When doing a docker compose down and then up it resolves the issue for a while. But then after a while it starts recreating some containers even when there are no changes. |
Looks like 2.17.3 is out now. Still waiting for the repository to be updated. Anybody know how long it takes for it to update? |
It took for ever for 2.17.2 to be available for installation using |
I'm still getting this issue on Docker Compose v2.23.3 and Docker v25.0.1. If I last ran The services being restarted are pretty ordinary, e.g.:
Does Docker Compose recreate containers only when the config file changes? If not, what are some other reasons? |
Heya, So I am also still seeing this issue with Docker Engine v25.0.3 and Docker Compose v2.24.5.
Which uses this docker-compose file..
And whenever the CRON job executes, it correctly pulls any new images, but restarts my container even if the image has not been updated. |
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 withextends
.Steps To Reproduce
docker-compose.yml
withextends
docker compose up -d
multiple timesCompose Version
Docker Environment
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: