Skip to content

[BUG] compose run --rm does not remove the container #12965

@rumpl

Description

@rumpl

Description

docker compose run --rm <service> doesn't remove the container any more.

Steps To Reproduce

With this yaml file

services:
  web:
    image: nginx

Run docker compose run --rm web, wait for the container to start and then ctrl+c

Then run docker ps -a and you should see something like

; docker ps -a
CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS       PORTS                                                                                          NAMES
66066872be26   nginx                    "/docker-entrypoint.…"   4 seconds ago   Created                                                                                                     test-web-1

With 3.27.1 the container is removed as it should.

Compose Version

3.27.2

Docker Environment

DD on a mac

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions