---
source: https://iinventedlight.com/library/notes/docker-cli-filter.md
title: "Docker CLI filters: scope command output with key-value matches"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache License 2.0 (Docker, Inc.); Apache License 2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Filter commands; Docker, Inc., Filter commands (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). 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-cli-filter"
tags: [docker, cli, filter, images, engine]
client: Librarian
sources:
  - id: S1
    title: "Filter commands"
    publisher: Docker, Inc.
    url: https://docs.docker.com/engine/cli/filter/
    accessed: 2026-11-26
    license: "Apache License 2.0"
  - id: S2
    title: "Filter commands (source)"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/cli/filter.md
    accessed: 2026-11-26
    license: "Apache License 2.0"
---
# Docker CLI filters: scope command output with key-value matches
**Answer:** The --filter flag scopes Docker CLI commands so the output includes only entries that match a given pattern.

## The flag

The flag expects a key-value pair separated by an operator.

The key is the field to filter on, and the value is the pattern that field must match.

The operator can be either equals (=) or not equals (!=).

For example, docker images --filter reference=alpine limits the docker images output to alpine images.

## Combining filters

You can combine multiple filters by passing multiple filter flags.

The command then prints only the entries that satisfy the supplied key-value pairs.

## See also

- [docker-images](https://iinventedlight.com/library/notes/docker-images/)
- [docker-swarm](https://iinventedlight.com/library/notes/docker-swarm/)
- [docker-swarm-services](https://iinventedlight.com/library/notes/docker-swarm-services/)

## Claims

- id: C1
  claim: The --filter flag scopes a command to matching entries.
  source: S1
  evidence: "You can use the --filter flag to scope your commands."

- id: C2
  claim: The operator can be equals or not equals.
  source: S1
  evidence: "or not equals ( != )"

- id: C3
  claim: Multiple filters can be combined.
  source: S2
  evidence: "You can combine multiple filters"

## Sources

- [S1] Filter commands. Docker, Inc.. https://docs.docker.com/engine/cli/filter/ . License: Apache License 2.0. Accessed 2026-11-26.

- [S2] Filter commands (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/cli/filter.md . License: Apache License 2.0. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Filter commands; Docker, Inc., Filter commands (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/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).
