Commit Graph
376 Commits
Author SHA1 Message Date
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
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
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
Dan Duvall fc3ecb60fb Preserve raw BUILDKIT_SYNTAX as cmdline option
Set gateway `source` to the first part of `BUILDKIT_SYNTAX` and
`cmdline` to the entire raw value to preserve additional options.

Signed-off-by: Dan Duvall <dduvall@wikimedia.org>
2025-08-26 13:56:07 -07:00
Will NonnemakerandDan Duvall b99e799f00 Add BUILDKIT_SYNTAX option handling
This fix allows building with a remote builder where
frontend.dockerfile.v0 enabled = false in the buildkitd yaml file.

Note that this change only allows the usage of BUILDKIT_SYNTAX with
a custom frontend image, and using the #syntax directive in this case
will still fail.

Resolves: docker#3077

Signed-off-by: Will Nonnemaker <wnonnemaker@gmail.com>
2025-08-26 13:51:22 -07:00
Jonathan A. Sternberg dbda218489 dap: make exec shell persistent across the build
Invoking the shell will cause it to persist across the entire build and
to re-execute whenever the builder pauses at another location again.

This still requires using `exec` to launch the shell. Launching by frame
id is also removed since it no longer applies to this version.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-08-11 12:40:09 -05:00
Tõnis TiigiandGitHub 9a07004534 Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2025-07-10 08:30:29 -07:00
Jonathan A. Sternberg 4f2e23a9b8 dap: add stack traces with next and continue functionality
It is now possible to send next and continue as separate signals. When
executing a build, the debug adapter will divide the LLB graph into
regions. Each region corresponds to an uninterrupted chain of
instructions. It will also record which regions depend on which other
ones.

This determines the execution order and it also determines what the
stack traces look like.

When continue is used, we will attempt to evaluate the last leaf node
(the head). If we push next, we will determine which digest would be the
next one to be processed.

In the future, this will be used to also support breakpoints.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-03 09:18:55 -05:00
Sebastiaan van Stijn fd87647da1 use "#nosec" instead of "nolint:gosec" to be more specific
The `#nosec` comment allows ignoring a specific rule; this prevents
potentially other "gosec" linting failulres from being silently ignored.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-03 13:31:06 +02:00
Tõnis TiigiandGitHub 758ea75f60 Merge pull request #3235 from jsternberg/dap-handler
dap: add debug adapter implementation
2025-07-02 12:58:07 -07:00
Jonathan A. Sternberg 42599a7d49 dap: add debug adapter implementation
Adds a simple implementation of the debug adapter that supports the very
basics of a debug adapter.

It supports the launch request, the configuration done request, the
creation of threads, stopping, resuming, and disconnecting from server.

It does not support custom breakpoints, stack traces, or variable
inspection yet. These are planned to be added in the future.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-30 10:51:20 -05:00
CrazyMax 2588b66fd9 build: fix buildx.build.provenance metadata
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-19 18:47:27 +02:00
CrazyMax 989978a42b bake: multi ips support for extra hosts
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-16 11:55:17 +02:00
Jonathan A. Sternberg e1adeee898 vendor: github.com/moby/buildkit v0.23.0-rc1
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-11 16:29:31 -05:00