# docker container prune: Remove Stopped Containers

> How docker container prune works: bulk-removing all stopped containers, age filters, and CI cleanup between jobs.

Source: https://latchkey.dev/learn/command-reference/docker-container-prune-command  
Updated: 2026-06-25

Remove every stopped container in one command.

docker container prune deletes all stopped containers at once. This page covers the filter flags and using it for CI cleanup.

## What it does

docker container prune removes all containers in the exited/created state. It is the bulk equivalent of docker rm on each stopped container.

## Common usage

```Terminal
docker container prune -f
docker container prune -f --filter "until=1h"
```

## Common errors in CI

Without -f it prompts and stalls non-interactive CI - pass -f. It only removes stopped containers, so a still-running one survives; stop it first if you need a clean slate. Running disposable containers with --rm avoids the need for this entirely.

## FAQ

### docker container prune: Remove Stopped Containers?

docker container prune deletes all stopped containers at once. This page covers the filter flags and using it for CI cleanup.

### What it does?

docker container prune removes all containers in the exited/created state. It is the bulk equivalent of docker rm on each stopped container.

### Common errors in CI?

Without -f it prompts and stalls non-interactive CI - pass -f. It only removes stopped containers, so a still-running one survives; stop it first if you need a clean slate. Running disposable containers with --rm avoids the need for this entirely.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
