Summary#
Docker Compose is best treated as a single-host orchestration tool for a relatively fixed set of services. If a workload needs multi-host scheduling, platform-managed self-healing, rolling updates, autoscaling, cluster networking, or cluster-level policy, use Kubernetes or another cluster orchestrator instead. For image updates, do not assume docker compose restart will pick up a newer image: pull or build the image first, then recreate the affected containers.
Problem#
Teams sometimes use Docker Compose as if it were a Kubernetes-like cluster orchestrator, or they expect a restarted container to automatically run a newer image tag. Both assumptions create deployment drift: the stack may lack the scheduling and rollout behavior the workload requires, and a container may continue running an older image even after an image has been updated in a registry or rebuilt locally.
Guidance#
Use Docker Compose when: - The deployment target is one host. - The service graph is relatively stable. - The main goal is reproducible local development, CI integration testing, or a small single-server stack. - Manual or external operational procedures are acceptable for host failure, scaling, and rollout control.
Use Kubernetes or another orchestrator when: - Workloads must be scheduled across multiple nodes. - Replicas, rolling updates, self-healing, autoscaling, service discovery, ingress, namespaces/RBAC, or cluster-level resource policy are required. - Deployment failures such as image pull errors, scheduling failures, readiness/liveness failures, and rollout status must be handled through a standardized platform workflow.
For image refreshes in Compose:
- Pull the new image (docker compose pull) or rebuild it (docker compose build / docker compose up --build) as appropriate.
- Recreate the affected containers (docker compose up -d with the updated image, or an explicit recreate flow) rather than relying on a plain restart.
- Avoid indiscriminate deletion of containers, volumes, or bind-mounted data. Recreate only the services that need the new image unless a broader migration is intentional.
Failure Modes#
- Using Compose for workloads that require multi-host scheduling, elastic scaling, or orchestrator-managed failover.
- Treating
docker compose restartas an image update mechanism and leaving old containers running old image layers. - Assuming
latestis enough to refresh runtime state without an explicit pull/build and container recreate. - Removing containers or volumes broadly and accidentally deleting stateful data or volume-backed resources.
- Treating Compose
deploy:or resource settings as Kubernetes-equivalent guarantees without checking the Compose implementation, Swarm mode, compatibility flags, and host cgroup behavior.
Related Vault Notes#
- Compose vs Kubernetes production boundary: broader decision boundary between Compose and Kubernetes.
- Docker Compose Hardening Patterns and Failure Modes: Compose hardening, healthcheck, read-only filesystem, capability, and runtime failure modes.
- Kubernetes deployment failure triage: operational triage once the workload is managed by Kubernetes.
Sources#
- Docker Docs — Compose overview: https://docs.docker.com/compose/
- Docker Docs — Compose production guidance: https://docs.docker.com/compose/production/
- Docker Docs —
docker compose pull: https://docs.docker.com/reference/cli/docker/compose/pull/ - Docker Docs —
docker compose up: https://docs.docker.com/reference/cli/docker/compose/up/ - Docker Docs — Compose Deploy Specification: https://docs.docker.com/reference/compose-file/deploy/
- Kubernetes Docs — Overview: https://kubernetes.io/docs/concepts/overview/
- Kubernetes Docs — Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- Kubernetes Docs — Services: https://kubernetes.io/docs/concepts/services-networking/service/
Sagwan Revalidation 2026-06-16#
- verdict:
revise - note: Core content remains valid, but the old Sources list contained unrelated Stack Overflow links. Rewritten around official Docker/Kubernetes references and connected to related vault notes.
Sagwan Revalidation 2026-06-16T23:03:54Z#
- verdict:
ok - note: Compose 단일 호스트 범위와 restart의 이미지 미갱신 설명은 여전히 유효함
Sagwan Revalidation 2026-06-17T23:09:44Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재도 유효함
Sagwan Revalidation 2026-06-18T23:39:47Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와 여전히 부합함
Sagwan Revalidation 2026-06-20T00:56:44Z#
- verdict:
ok - note: Compose 범위와 restart 이미지 갱신 동작 설명은 현재도 유효하다.
Sagwan Revalidation 2026-06-21T01:12:17Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 관행과도 부합함
Sagwan Revalidation 2026-06-22T02:04:31Z#
- verdict:
ok - note: Compose 범위와 이미지 재생성 동작 설명은 현재도 유효하다.
Sagwan Revalidation 2026-06-23T02:35:35Z#
- verdict:
ok - note: [chatgpt HTTP 401] {
Sagwan Revalidation 2026-06-24T02:42:49Z#
- verdict:
ok - note: [chatgpt HTTP 401] {
Sagwan Revalidation 2026-06-25T04:59:53Z#
- verdict:
ok - note: [chatgpt HTTP 401] {
Sagwan Revalidation 2026-06-26T06:00:52Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와도 일치함
Sagwan Revalidation 2026-06-27T10:11:22Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 관행과 맞습니다.
Sagwan Revalidation 2026-06-28T10:37:52Z#
- verdict:
ok - note: [chatgpt HTTP 500]
Sagwan Revalidation 2026-06-29T11:24:32Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와 부합함
Sagwan Revalidation 2026-06-30T16:05:47Z#
- verdict:
ok - note: Compose와 이미지 재생성 동작에 대한 핵심 권장안은 여전히 유효함
Sagwan Revalidation 2026-07-01T23:18:02Z#
- verdict:
ok - note: Compose 범위와 이미지 재생성 동작 설명이 현재 practice와 맞다.
Sagwan Revalidation 2026-07-03T12:14:45Z#
- verdict:
ok - note: Compose 범위와 이미지 재생성 동작 설명은 현재 관행과 맞다.
Sagwan Revalidation 2026-07-04T19:21:11Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와도 일치함
Sagwan Revalidation 2026-07-06T00:09:30Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재도 유효함
Sagwan Revalidation 2026-07-07T05:59:21Z#
- verdict:
ok - note: Compose 범위와 restart 이미지 갱신 동작 설명은 현재도 유효함
Sagwan Revalidation 2026-07-08T12:36:33Z#
- verdict:
ok - note: Compose 범위와 restart의 이미지 미갱신 설명은 현재도 유효하다.
Sagwan Revalidation 2026-07-10T14:02:54Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 관행과도 부합함
Sagwan Revalidation 2026-07-12T07:36:36Z#
- verdict:
ok - note: Compose 범위와 restart의 이미지 미갱신 설명은 현재 관행과도 일치함
Sagwan Revalidation 2026-07-14T03:30:06Z#
- verdict:
ok - note: Compose 범위와 restart의 이미지 미갱신 설명은 현재도 유효함
Sagwan Revalidation 2026-07-16T04:02:04Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와 맞다.
Sagwan Revalidation 2026-07-18T05:55:56Z#
- verdict:
ok - note: Compose 범위와 restart 이미지 미갱신 설명은 현재 관행과 일치함
Sagwan Revalidation 2026-07-20T06:37:37Z#
- verdict:
ok - note: Compose 범위와 restart의 이미지 미갱신 설명은 현재도 유효함
Sagwan Revalidation 2026-07-22T09:02:06Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 practice와 일치함
Sagwan Revalidation 2026-07-24T11:15:40Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 관행과 여전히 부합함
Sagwan Revalidation 2026-07-26T13:44:19Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재 관행과 일치함
Sagwan Revalidation 2026-07-28T20:54:23Z#
- verdict:
ok - note: Compose 범위와 restart 이미지 갱신 동작 설명은 현재도 유효함
Sagwan Revalidation 2026-07-31T02:34:11Z#
- verdict:
ok - note: Compose 범위와 이미지 갱신 동작 설명은 현재도 유효하다.