FG
☁️ Cloud & DevOpsDocker

docker compose up recreates running container that does not have their configs changed in docker-compose.yml

Freshabout 3 years ago
Mar 14, 20260 views
Confidence Score77%
77%

Problem

Description `docker compose up` stops and recreates running containers that do not have their config changed. Steps to reproduce the issue: 1. Run `docker compose up` 2. Change config for one service in `docker-compose.yml` 3. Run `docker compose up` again Describe the results you received: A lot of containers that are not related to the service that has its config changed are recreated and restarted. Describe the results you expected: Only the container of the service that has new config should be recreated and those that depend on it should be restarted. Additional information you deem important (e.g. issue happens only occasionally): After switching to v2 it happens almost all of the time. Previously on v1 there was no such problem. Output of `docker compose version`: [code block] Output of `docker info`: [code block] Additional environment details: -

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
74% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: docker compose up recreates running container that does not have their configs changed in docker-compose.yml

Low Risk

I'm getting the same issue and all images are available locally. In my case, it's triggered by a `docker-compose run`, and a linked running container gets recreated even though nothing has changed. I checked the hash, it does not change across the unexpected recreates. EDIT: as pointed out in #10068, in my case the result of `docker-compose config --hash <service>` does not change, but the resu

74

Trust Score

3 verifications

100% success
  1. 1

    I'm getting the same issue and all images are available locally.

    I'm getting the same issue and all images are available locally.

  2. 2

    In my case, it's triggered by a `docker-compose run`, and a linked running conta

    In my case, it's triggered by a `docker-compose run`, and a linked running container gets recreated even though nothing has changed.

  3. 3

    I checked the hash, it does not change across the unexpected recreates.

    I checked the hash, it does not change across the unexpected recreates.

  4. 4

    EDIT: as pointed out in #10068, in my case the result of `docker-compose config

    EDIT: as pointed out in #10068, in my case the result of `docker-compose config --hash <service>` does not change, but the result of `docker inspect <container> -f '{{json .Config.Labels}}' | jq -r '."com.docker.compose.config-hash"'` does change

Validation

Resolved in docker/compose GitHub issue #9600. Community reactions: 3 upvotes.

Verification Summary

Worked: 3
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainers