Commit Graph
387 Commits
Author SHA1 Message Date
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
Tonis Tiigi c5154b3169 update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-09 18:54:15 -08:00
Justin Chadwell 3e413a05df build: split out node resolver
Signed-off-by: Justin Chadwell <me@jedevc.com>
2025-12-04 09:48:36 +00:00
CrazyMax 1b9791f6fe fix empty provenance metadata for multi-platform builds
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-11-25 17:39:46 +01:00
Sebastiaan van Stijn 18dc2e088a vendor: github.com/moby/moby/api v1.52.0, moby/client v0.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 01:30:02 +01:00
Tonis Tiigi 1fae6f4c2a build: avoid panic on linking to nil target
Note that nil targets still do not work as buildkit
does not currently support build inputs with nil values.

But this gives cleaner error from buildkit instead of
panic on the client side.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-11 11:28:53 -08:00
Tõnis TiigiandGitHub 484a32f259 Merge pull request #3478 from crazy-max/fix-tar-output
build: create parent directories for tar output in lazy writer
2025-11-05 16:42:44 -08:00
Tonis Tiigi e13cd5c9df imagetools: support for creating attestations/signatures
Persist attestation manifest and any manifest cosign-based
signatures when creating new images.

When creating index from single-arch manifests where attestation
manifest is not inlined, it can be loaded from referrers API.
Note that for this to work the attestation manifest needs to be
in artifact type when image was built.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit aab8171f824d13d703e869107e1720ad71d24bff)
2025-11-05 12:59:27 -08:00
CrazyMax 28b6750599 build: create parent directories for tar output in lazy writer
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-22 11:50:32 +02:00
Tonis Tiigi f448f3e22b imagetools: add platforms filter to imagetools create
Allows specifying platforms that should be included
in the new image, making it possible to reduce platforms
of existing multi-arch image. Previously the individual
image manifests needed to be used as sources, but that
dropped their related attestation manifests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-23 08:10:11 -07:00
Tõnis TiigiandGitHub 3922da8029 Merge pull request #3418 from crazy-max/go-mod-1.24
go.mod: bump to go 1.24
2025-09-09 14:06:51 -07:00
CrazyMax 0beb1b3f2b lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 22:07:37 +02:00
Tonis Tiigi 5a3afbf839 build: set original url to attrs when replacef with input
Save original URL so it can be picked up from provenance attestation.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-09 11:08:00 -07:00
Tonis Tiigi c737e84f94 build: allow client side querystring resolution
For the cases where frontend/buildkit doesn't support new
Git Querystring format, allow resolving the URL into LLB
on client side and then build from input.

Note that this produces slightly different provenance
where context is not set as string, so added opt-in
via environment variable for now.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-08 17:40:31 -07:00
Tonis Tiigi 5e6951c571 git querystring frontend capability detection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-02 10:46:37 -07:00
Tonis Tiigi 1f39ad2001 vendor: update buildkit to v0.24.0-rc2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-08-29 14:49:16 -07:00
Tonis Tiigi ec3b99180b vendor: update buildkit to v0.24.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-08-27 13:39:14 -07:00
Tõnis TiigiandGitHub df7c46b02d Merge pull request #3384 from crazy-max/export-annotations-check
build: fail early if trying to export index annotations with moby exporter
2025-08-27 08:44:51 -07:00
CrazyMax a8f546eea5 build: fail early if trying to export index annotations with moby exporter
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-27 11:17:31 +02:00