Commit Graph
647 Commits
Author SHA1 Message Date
Jiří Moravčík 9b37d78c89 build: improve resource limits output and docs
Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
2026-06-11 11:18:35 +02: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
CrazyMaxandCrazyMax 473c6ef306 bake: requires explicit allow for local output delete mode
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-10 16:41:09 +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
Tõnis TiigiandGitHub 5b40913913 Merge pull request #3832 from crazy-max/bake-policy-flag
bake: global policy evaluation options
2026-05-11 10:58:38 -07:00
CrazyMax da8fa45c1c bake: global policy evaluation options
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-05-07 11:11:59 +02:00
CrazyMax c29a51f33f commands: remove redundant stdinDone reset in dial-stdio
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-05-07 10:26:45 +02:00
CrazyMax 4c6d9c0b7f commands: stop dial-stdio when the builder connection closes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-05-06 19:10:43 +02:00
CrazyMax 2574d4c0d0 rm: reject context builders before loading nodes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-24 17:27:57 +02: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
Jonathan A. Sternberg d781c83cec commands: micro optimization for source date epoch
Avoids the call to `os.Getenv` when it is unnecessary because it would
be overwritten anyway.

Removes the comments about moving environment variable parsing to a
method for use by library consumers. That method exists in containerd
and this set of code doesn't actually perform any parsing since the
parsing of this time is done within buildkit and not on the client.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-04-03 10:02:50 -05:00
Tõnis TiigiandGitHub 7ac8168016 Merge pull request #3738 from tonistiigi/policy-eval-upt
Updated for policy eval
2026-03-24 17:08:04 -07:00
Tonis Tiigi 64cd4136d9 policy: support reading policy from stdin via --file -
Allow passing policy content through stdin by specifying
"--file -" in the eval command. This enables piping policy
data without requiring a file on disk.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-23 11:13:46 -07:00
Tonis Tiigi 7df7b4205b policy: align eval file flag
Use --file/-f for policy eval and keep hidden --filename as a
backward-compatible alias.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-23 11:04:14 -07:00
Tonis Tiigi 9dcb37f47c policy: add --platform to eval
Allow buildx policy eval to accept an explicit target platform and skip
worker platform discovery when the flag is provided.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-23 11:04:12 -07:00
Jonathan A. Sternberg a8d359a9ca dap: make dap generally available
Removes the experimental flags and bits for dap and deletes some dead
code that somehow made its way this far without anyone noticing.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-23 10:43:27 -05:00
Jonathan A. Sternberg 180cfd9e41 dap: pass exit code through exited event
Pass the exit code through the exited event back to the client and
ensure that the printed text is printed completely.

Previously, the exited event just had a big todo and the printer would
sometimes fail to send messages to the connected client. This moves the
printer wait to before the debug adapter is closed to ensure that all
messages get sent through the connection to the editor. While there, I
also plumbed in the exit code to exited. It's not necessarily the real
exit code but it will produce a zero on build success and a non-zero
code on build failure so that should be good enough.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-20 14:02:21 -05:00
Tõnis TiigiandGitHub a0a8f63cd5 Merge pull request #3730 from crazy-max/history-mv-buildname
history: move BuildName to util/history
2026-03-19 16:55:45 -07:00
Tonis Tiigi e4f6e373af imagetools: share ingester across concurrent copies
Reuse a single ingester per target repository when imagetools create
copies multiple manifests in parallel.

This lets the pushing ingester serialize same-digest pushes and avoids
racing duplicate blob uploads against registries to work around bug in
Registry v3.0.0 (and possibly others).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-17 17:18:55 -07:00
CrazyMax b272a37d46 history: move BuildName to util/history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 23:49:53 +01:00
CrazyMaxandCrazyMax b1a2f3006b history: finalize export records on their owning node
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 11:08:18 +01:00
Tõnis TiigiandGitHub 88b75da82d Merge pull request #3717 from crazy-max/fix-history-export-clients
history: deduplicate node clients during export
2026-03-13 17:36:47 -07: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
CrazyMax 4643e50bd3 history: deduplicate node clients during export
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-11 16:24:54 +01:00
Jonathan A. Sternberg ca9df87014 dap: fix the race condition in the dap unit tests
The context used for serving the dap server was being canceled too early
because it used defer which would initiate at the end of the function
while every other cleanup function used `t.Cleanup` which executes in
its own goroutine.

One possible solution was to move the cancel to the cleanup, but the
context being passed to serve and start doesn't make sense because if it
ever does get canceled, it'll likely cause a similar race condition with
`Stop`.

This removes the context from the methods that were causing this issue
in favor of just relying on the caller calling `Stop` when they are done
with the adapter and server.

This seems to have only affected tests and I don't believe it affected
the actual dap command.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-10 12:03:35 -05:00
Tonis Tiigi 88cba2c367 policy: avoid stale invalid field warnings in eval
Track fields reloaded during eval --print resolution loops and filter
final invalid-field warnings against that set.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 09:14:31 -08:00
Tonis Tiigi 4880756a0f policy: simplify recursive material resolution
Unify root/material unknown resolution with recursive Input traversal.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 09:14:25 -08:00
CrazyMax f4cc8638c0 commands: make builder status timeouts configurable across cli flows
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-24 17:54:12 +01:00
CrazyMaxandGitHub a0103f4278 Merge pull request #3653 from tonistiigi/util-sourcemeta-resolver
policy: separate sourcemetaresolver utility to reusable pkg
2026-02-17 10:11:36 +01:00
Tonis Tiigi 499261eed5 build: avoid empty line when -q used with --call
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-13 17:11:35 -08:00
Tonis Tiigi dce5289722 policy: separate sourcemetaresolver utility to reusable pkg
Turn the current utility used by policy helper commands that
allows getting gateway.Client lazily into reusable package.

This is preparation for using this utility also in the policy
verification, outside of commands.

Only expose SourceMetaResolver as other methods of gateway client
are not needed atm by any callers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-13 13:59:33 -08:00
Tonis Tiigi 8d605dcd87 policy: add image.provenance input type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-12 11:59:06 -08:00
Tõnis TiigiandGitHub bcb8583078 Merge pull request #3638 from crazy-max/imagetools-create-digest
imagetools: metadata-file flag
2026-02-11 10:59:38 -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
CrazyMax a2f3c6a1b8 imagetools: metadata-file flag
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-10 13:52:00 +01:00
Tonis Tiigi 4e16277937 policy: update unknown keys normalization
Make the code more unified between validation and
test command. Normalize to key without the input prefix.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-09 18:27:35 -08:00
Jonathan A. Sternberg 3e0e9333c2 commands: adds metrics associated with the debugger
Add metrics associated with the debugger that are reported through the
metrics writer. This adds a few attributes that are only added when a
debugger is used with either the `debug` command or `dap` command.

At the moment, these metrics show up the exact same as a build and we
can't identify if something is using `dap` or `debug` since they use the
same code path.

This also adds a new available metric that can be utilized by plugins to
report additional information. The metrics will check if an environment
variable `BUILDX_DAP_USER_AGENT` is sent and that will get included in
the metrics if they are enabled.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-01-28 14:05:11 -06:00
Tonis Tiigi 87c77aca7b imagetools: avoid trying to load attestations inline references
When creating resulting image index it is wasteful
to check for attestations for the descriptors in original
index what were already attestation for subject manifest.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-28 08:28:29 -08:00
Tonis Tiigi 510369170a imagetools: fix excessive copies on create command
Currently needed manifests were filtered out and then
copied in a loop, but for each copy still the full
unfiltered descriptor was copied instead of single
manifest, resulting multiple push attempts for same
descriptor.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-28 08:27:17 -08:00
CrazyMaxandGitHub 841017f665 Merge pull request #3629 from thaJeztah/errs_alias
use consistent alias for stdlib "errors"
2026-01-27 12:58:14 +01:00
CrazyMaxandGitHub fd4fbd0be8 Merge pull request #3626 from thaJeztah/native_multierror
commands/history: rewrite with stdlib multi-errors
2026-01-27 12:53:12 +01:00
Sebastiaan van Stijn 3eee42b002 use consistent alias for stdlib "errors"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-27 11:14:27 +01:00
Sebastiaan van Stijn 39ee64df71 commands/history: rewrite with stdlib multi-errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-01-26 12:53:33 +01:00
Tonis Tiigi 8f71a4805e imagetools: remove temp workaround for fixed containerd bug
The issue has been fixed in containerd/containerd#12508

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-23 09:50:20 -08:00
Tõnis TiigiandGitHub 9567f7f4d2 Merge pull request #3614 from tonistiigi/policy-json-stub
commands: remove policy json-schema stub
2026-01-16 14:27:33 -08:00
Tonis Tiigi d0e4db27e0 commands: remove policy json-schema stub
Remove stub for now so we don't ship it in a release.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 12:48:46 -08:00
Tonis Tiigi 89fdef17e6 policy: fixes for image source handling
- Make sure tag is added to image reference as
containerd reference parser refuses to parse otherwise.

- When attestation is asked from non-index, return
nil instead of error. This is for consistency as likely
to fail in BuildKit before that is fixed separately.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 12:12:41 -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 c5322ca727 bake: add --var flag for setting variable values
This provides alternative way to set values for Bake
variables without adding them the global environment variables.
This can also be used then environment variable access
is disabled with BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-15 23:17:28 -08:00