Skip to content

[BUG] compose down fails when it depends_on missing init containers #11686

@koooge

Description

@koooge

Description

Hi there, I encountered an issue of docker compose down with depends_on init containers. compose down fails when the init containers are not running and missing after completed it. In my scenario, init containers can be removed by docker system prune.

Steps To Reproduce

  1. Create services depends_on init containers
  2. docker compose -p some-proj up -d #=> containers run and init containers stop with service_completed_successfully
  3. docker system prune -af #=> init containers are removed
  4. docker compose -p some-proj down #=> error could not find init-container: not found

Compose Version

Docker Compose version v2.25.0

Docker Environment

$ docker info
Client: Docker Engine - Community
 Version:    26.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.13.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.25.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
...

Anything else?

--remove-orphans option does not help it.

#8122

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions