• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 24859780233

23 Apr 2026 09:28PM UTC coverage: 92.936% (+0.01%) from 92.926%
24859780233

push

github

web-flow
Feature: Support extracting file/directory artifacts from Docker image layers (#23270)

Adds `output_files`, `output_directories`, and `outputs_match_mode`
attributes to the `docker_image` target, matching the behavior of the
same target attributes of `shell_command` and `adhoc_tool`.

This effectively uses the Docker CLI arguments of `--output
type=local[,parameters]` which is the `local` exporter. Then it uses the
same glob behavior to extract and digest cache the specified files or
directories, enabling using Docker as a cache-able build environment
usable in subsequent and dependent targets.

I have tested it extensively locally for a use-case of building
out-of-tree CoreDNS plugins, and having it as a dependency on a
`run_shell_command` target that builds a custom Debian 13 LXC that
configures CoreDNS for use in the Proxmox environment.

The docs have been updated to provide a "Hello World" example. Do note
that, if there is more than one stage, or the artifacts you want to
extract are not in the last stage of the Dockerfile, you will need to
specify the `target_stage` attribute in the `docker_image` target. This
is mentioned in the docs.

Also, I fixed a minor bug where this, the `shell_command` and
`adhoc_tool` would double-warn on an unmatched path.

146 of 150 new or added lines in 4 files covered. (97.33%)

91829 of 98809 relevant lines covered (92.94%)

4.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

99.14
/src/python/pants/backend/docker/target_types.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc