Filter images and tags
Most ContainerHive commands accept image:tag filters as positional arguments to target specific images or tags instead of processing the entire project.
Syntax
| Pattern | Matches |
|---|---|
| (none) | All images and tags |
ubuntu |
All tags of the ubuntu image |
ubuntu:24.04 |
Only tag 24.04 of image ubuntu |
ubuntu:24.04 alpine:3.20 |
Both specified image:tag combinations |
Commands that support filtering
ch build— build only matching imagesch test— test only matching imagesch sbom— generate SBOMs for matching imagesch finalize— create manifests for matching images
Examples
Build a single image:
Build a specific tag:
Test multiple images:
Generate SBOMs for one image:
Variant tags
Variant tags include the tag suffix defined in image.yml. To filter for a variant, specify the full tag including the suffix:
Matching rules
- If no filters are provided, all images and tags are processed.
- Image name matching is exact — no wildcards or glob patterns.
- Tag matching is exact — no wildcards or glob patterns.
- Specifying only an image name matches all tags of that image.
- Multiple filters are combined with OR logic — an image:tag matches if it matches any filter.