Commit Graph
405 Commits
Author SHA1 Message Date
Tõnis TiigiandGitHub dd388bf70e Merge pull request #3883 from crazy-max/local-output-delete
support BuildKit local output delete mode
2026-06-10 14:14:12 -07:00
CrazyMax b6e1b7328f build: gate local delete outputs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-10 16:41:10 +02:00
Tonis TiigiandCrazyMax 4da04e3bf4 policy: enable proxy network from source policy caps
Evaluate source policy caps before solve requests so policies can enable
BuildKit proxy networking. Policy can return caps {"exec.proxy": true}
during the caps request to enable proxy network
support for the solve.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-06-10 15:04:23 +02:00
Jiří Moravčík 80b2293881 build: Add per-step CPU and memory resource limits
Port of moby/buildkit#6569 to buildx. Adds --memory, --memory-swap,
--cpu-shares, --cpu-period, --cpu-quota, --cpuset-cpus, and --cpuset-mems
flags to build, plus the equivalent bake target attributes and compose
x-bake fields.

Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
2026-06-08 15:39:14 +02:00
Tonis Tiigi 4dd20d3c03 build: fix policy resolver cleanup on errors
Keep policy resolver cleanup in a local variable so explicit error returns
cannot clear it before deferred cleanup runs. This prevents remote policy
progress writers from outliving the build printer.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-06-03 20:56:04 -07:00
Tonis Tiigi 0c04ba8d36 policy: preserve late progress errors
Emit a final policy progress completion with the solve error even when the
inactivity window already completed the vertex.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-05-07 12:09:50 -07:00
Mateusz Gozdek 142cd448de Fix panic in buildx debug when solving fails
Closes #3822

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2026-05-04 15:49:45 +02:00
Tõnis TiigiandGitHub 14ef96b3b5 Merge pull request #3807 from tonistiigi/buildx-default-policy
policy: add builtin default source policy
2026-04-24 12:23:25 -07:00
CrazyMax dcf533e756 build: fix oci-layout named context serialization
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-23 12:26:02 +02:00
Tonis Tiigi 0e50635195 policy: add builtin default source policy
Embed an opt-in default source policy for Docker-managed frontend images.
Load it ahead of user policies when enabled, and cover behavior with table-
driven policy tests for signed, unsigned, floating, and labs tags.

Makes sure if there is any attack against the docker/dockerfile
releases, or they accidentally point to worng images, these are automatically detected.

In a future release these should become opt-out.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-04-20 16:32:39 -07:00
CrazyMax 720f91fdd4 gitutil: migrate to BuildKit GitCLI API
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-09 14:57:38 +02:00
CrazyMax 7c44ec11ec build: reject empty BUILDKIT_SYNTAX overrides
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-24 15:35:08 +01:00
Tõnis TiigiandGitHub 3b8709777a Merge pull request #3701 from jsternberg/dap-fix-can-invoke
dap: fix the check to determine whether exec will succeed
2026-03-17 09:36:00 -07:00
Jonathan A. Sternberg b33ef2c9d4 dap: fix the check to determine whether exec will succeed
This refines the check for determining whether exec will succeed to work
when an error occurs. This check previously relied on the `Ref` being
populated in the result context but this would only happen if we were
paused from a breakpoint or by stepping. An error would not fill in this
field.

The check is now refined to use the new gateway filesystem exec API so
we can create the container and then check even if we don't have a
returned gateway reference. The logic to determine which mount to check
has also been moved.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-17 10:31:11 -05:00
Tonis Tiigi 9894189361 imagetools: support oci-layout refs
Add oci-layout:// source and target support to imagetools create and
inspect while keeping merge, filter, and referrer logic shared.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:45:01 -07:00
CrazyMaxandGitHub c4b5d6766e Merge pull request #3697 from crazy-max/build-arg-proxy
build: make proxy build-arg override check case-insensitive
2026-03-11 09:28:17 +01:00
CrazyMax 189633f43c build: make proxy build-arg override check case-insensitive
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-05 16:16:54 +01:00
Tonis Tiigi 2adc53cfb3 build: parallelize forced reference evaluation
Use an errgroup helper to evaluate result refs concurrently during forced
evaluation, and fail fast on the first evaluation error.

This mitigates current case in bake where chained targets with
a multi-platform build could miss secrets and other session properties.

The outline for the issue case:
- Base target is solved but only lazily and not really loaded/tracked
in build graph yet.
- Child targets are loaded, base target waits.
- Evaluate is called for base stage (because it might be missing result
condition), child stage is processed as build result. This happens in
parallel.
- Because `Evaluate()` was called synchronously, it may have not been
 called yet for the second platform while the child target already
 needs to run `RUN --mount=type=secret`.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-04 18:09:41 -08:00
CrazyMax 2ed4ece865 build: reuse build session for policy source resolution
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-04 17:21:20 +01:00
CrazyMaxandGitHub 989b8637c9 Merge pull request #3674 from tonistiigi/policy-fs-refs-fix
build: ref-count policy FS lifecycle
2026-02-27 15:52:36 +01:00
Tonis Tiigi f3a1249560 build: normalize policy env filename default
Use cleaned DockerfilePath basename for policy env filename and fall back
to Dockerfile when the path resolves to dot or root.

Previously filename could be reported as "." on default cases.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 21:13:03 -08:00
Tonis Tiigi 9ef416b258 build: ref-count policy FS lifecycle
Make memoized policy FS ref-counted so repeated get()/close() pairs don't
prematurely close shared handles.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 18:48:38 -08:00
Tonis Tiigi b62fc30524 build: resolve policy files from context state and unified FS
Support remote context policy files via resolved context state and cwd:// override.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-23 16:22:19 -08:00
Tõnis TiigiandGitHub 5830f90beb Merge pull request #3657 from tonistiigi/policy-artifact-verification
policy: add artifact attestation and github attestation builtin support
2026-02-23 09:15:43 -08:00
Tõnis TiigiandGitHub 268f1c7e4a Merge pull request #3450 from jsternberg/dap-container-fs-requests
dap: utilize the container filesystem for the file explorer
2026-02-22 21:50:28 -08:00
Tõnis TiigiandGitHub 5683e9f04f Merge pull request #3470 from yzewei/tests_fix
tests: replace aaa/bbb node names with descriptive builder names
2026-02-22 21:49:34 -08:00
Tonis Tiigi 5c3551beeb policy: add GitHub attestation verification
Add github_attestation and github_release_attestation policy support.
Fetch GitHub attestation bundles (including bundle_url .json.sn decode)
and verify against input.http.checksum.

Wire source metadata resolver progress through resolver options and add
ResolveState support for policy HTTP attestation fetches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-20 08:56:40 -08:00
Tonis Tiigi 048ebea483 policy: mark policy progress vertex on DENY build failures
Track denied source identifiers during policy evaluation and flag the policy
progress vertex as failed when BuildKit returns a matching DENY error pattern.

This improves the progress output of policy error and shows last
policy logs with the build error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-18 17:19:54 -08:00
Tõnis TiigiandGitHub 7940a9650d Merge pull request #3646 from crazy-max/urlutil
history: don't import build package
2026-02-11 10:59:05 -08:00
CrazyMax 7899695fa6 history: don't import build package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-11 10:29:47 +01:00
CrazyMaxandGitHub 9bfd2a4b5c Merge pull request #3462 from crazy-max/bake-input-context
bake: set input:context for remote builds
2026-02-11 09:41:30 +01:00
yzeweiandCrazyMax 41f9e7db99 tests: replace aaa/bbb node names with descriptive builder names
Signed-off-by: yzewei <yangzewei@loongson.cn>
2026-02-09 16:41:11 +01:00
CrazyMax f60c7c9069 bake: set input:context for remote builds
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-09 13:50:19 +01:00
Jonathan A. Sternberg 1da36d13e8 dap: use container fs requests to get a more accurate state for the file system
The container filesystem request API that has been added to buildkit
allows a container created through the `NewContainer` API to also access
the filesystems. This is useful when an error occurs because it allows
us to grab the mutable state of the mounts used during the actual build
rather than the input version copies which don't contain any files that
were added as part of the failed command.

This gives us a more accurate view of the filesystem that was previously
only accessible through using `exec` and `ls`/`cat` commands that may
not always exist.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-02-05 09:40:55 -06:00
Tonis Tiigi c01e50342b build: send individual shared keys for local build contexts
Allows avoiding the case where two separate builds using
same context name would use the same destination directory
for upload.

Requires updated frontend to handle these new keys.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-20 19:08:05 -08:00
Tonis Tiigi 73f5b1f9c7 policy: update policy progress logic
Fix the policy logger being open for the whole build.

In new logic logger is opened on-demand if there are logs,
remains open until timeout and is restarted if new logs
come after.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 11:48:55 -08:00
Tonis Tiigi 20405112c2 policy: allow image source without set platform
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 11:48:55 -08:00
Tonis Tiigi 9f1daffb32 policy: implement policy support for bake
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:23 -08:00
Tonis Tiigi be42b48462 policy: implement policy logging via progress printer
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:34 -08:00
Tonis Tiigi 5ad09ce3eb commands: implement policy eval command
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:33 -08:00
Tonis Tiigi 61843e0031 policy: add strict policy config support
Strict policy will fail if remote daemon doesn't support policy
verification.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:09:10 -08:00
Tonis Tiigi 0e1036bef5 policy: add multiple policy support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:09:10 -08:00
Tonis Tiigi 4af8cdb6af build: add --policy flag for controlling policy configuration
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:09:08 -08:00
Tonis Tiigi 87d4189039 policy: image signature verification support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:03:42 -08:00
Tonis Tiigi 70da643c58 policy: add helper modules loading
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:03:42 -08:00
Tonis Tiigi 7247c1e38e policy: print debug helper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:03:42 -08:00
Tonis Tiigi 93341aaeee add rego integration to source policies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:03:40 -08:00
Paweł Gronowski 41a1782b35 build: Don't unpack by default when pushing
Automatically set `unpack=false` for registry exports unless explicitly
overridden by the user.

This applies to:

- `registry` exporter type (converted to `image` exporter with `push=true`)
- `--push` flag usage with image exporters

Users can still explicitly set `unpack=true` if they need local image
storage alongside registry push.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-01-14 16:04:45 +01:00
Tõnis TiigiandGitHub 424fd833cb Merge pull request #3583 from jsternberg/oci-layout-at-sign-in-path
build: handle at symbols in an oci-layout path
2026-01-12 21:45:55 -08:00
Jonathan A. Sternberg 2e76c05592 build: handle at symbols in an oci-layout path
The buildx command line will now handle `@` symbols in the
`oci-layout://` path when used with named contexts. Instead of
assuming the `@` symbol is part of the reference digest, it will first
check that it is a valid reference digest. Otherwise, it will assume
it's part of the file path.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-01-12 11:19:51 -06:00