---
source: https://iinventedlight.com/library/notes/docker-image-prune.md
title: "docker image prune: remove unused images"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (Docker CLI); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker image prune; Docker CLI, docker image prune CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-image-prune"
tags: [docker, prune, images, dangling, cli]
client: Librarian
sources:
  - id: S1
    title: "docker image prune"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/cli/docker/image/prune/
    accessed: 2026-11-23
    license: "Apache-2.0"
  - id: S2
    title: "docker image prune CLI reference"
    publisher: Docker CLI
    url: https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/image_prune.md
    accessed: 2026-11-23
    license: "Apache-2.0"
---
# docker image prune: remove unused images
**Answer:** docker image prune removes unused images. By default it removes all dangling images. With --all, it also removes images not referenced by any container.

## Default and --all

--force skips the confirmation prompt.

--all will remove all unused images, not just dangling ones.

If -a is specified, also remove all images not referenced by any container.

The default action is to remove all dangling images.

## Filters

The --filter flag format is of key=value. Pass multiple flags when more than one filter is required.

Different keys combine with AND logic, so an image must satisfy every condition before it is pruned.

The same key combines with OR logic, so a match on any of those values is enough.

Supported filters are until, which drops images created before a timestamp, and label, including label!= forms.

until accepts Unix timestamps, date formatted timestamps, or Go duration strings such as 10m or 1h30m, computed relative to the daemon machine's time.

Even with --filter, the confirmation prompt still warns that all dangling images will be removed.

## See also

- [docker-system-prune](https://iinventedlight.com/library/notes/docker-system-prune/)
- [docker-images](https://iinventedlight.com/library/notes/docker-images/)
- [docker-rm](https://iinventedlight.com/library/notes/docker-rm/)

## Claims

- id: C1
  claim: By default, prune removes all dangling images.
  source: S1
  evidence: "Remove all dangling images"

- id: C2
  claim: --all also removes images not referenced by any container.
  source: S1
  evidence: "remove all images not referenced by any container"

- id: C3
  claim: --force does not prompt for confirmation.
  source: S1
  evidence: "Do not prompt for confirmation"

- id: C4
  claim: Filters with different keys are combined using AND logic.
  source: S2
  evidence: "combined using AND logic"

- id: C5
  claim: until accepts Unix timestamps or Go duration strings such as 10m.
  source: S1
  evidence: "Unix timestamps, date formatted timestamps, or Go duration strings"

## Sources

- [S1] docker image prune. Docker Docs. https://docs.docker.com/reference/cli/docker/image/prune/ . License: Apache-2.0. Accessed 2026-11-23.

- [S2] docker image prune CLI reference. Docker CLI. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/image_prune.md . License: Apache-2.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker image prune; Docker CLI, docker image prune CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
