Commit Graph
179 Commits
Author SHA1 Message Date
CrazyMax aac040df56 bake: fix file-relative target references
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-07-21 11:25:56 +02:00
CrazyMax b1f1ac27bd bake: fix inherited file-relative contexts
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-07-21 11:25:56 +02:00
CrazyMax bc32533b6e bake: align compose path base with compose
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-07-21 11:25:55 +02:00
CrazyMax 1dc55abd89 bake: make file-relative paths definition-scoped
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-07-21 11:25:55 +02:00
CrazyMaxandCrazyMax b38d1004e3 bake: add file-relative path opt-in
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-07-21 11:25:55 +02:00
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
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
CrazyMax 09f288c71e bake: sort extra-hosts before generating build options
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-09 15:53:24 +02:00
CrazyMax 50fa13d859 bake: preserve git subdir in remote bake context paths
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-03 17:47:07 +01:00
Tonis Tiigi d39a81e456 bake: fix remote named context subdir handling
Fix using CopyDirContentsOnly when projecting remote named contexts so
subdir contexts keep the same root semantics as local bake runs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-27 17:06:32 -08:00
CrazyMax 26c7ae6fbf bake: derive git auth host from remote URL
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-24 18:09:52 +01: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 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 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
Tonis Tiigi d27c7f8e9f bake: allow disabling env lookup for bake
Allow bake to be run in a mode where the local environment
variable values can't be captured by bake definition.

In future we will likely also add --var k=v for alternative
way to pass values to variables.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 14:18:26 -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
Tõnis Tiigi 37e283ceb0 auth: add option to load docker config for specific repo/scope
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-07 11:45:04 -08: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
Sebastiaan van Stijn 36b18a4c7a remove some intermediate vars
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-06 23:00:24 +02:00
CrazyMax 9d56b30c42 bake: fix dockerfile default if empty
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-31 10:02:44 +02:00
CrazyMax 7c22db3c34 bake: add pattern matching for targets input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-01 10:53:02 +02:00
CrazyMax b514ed45fb bake: extra-hosts support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-11 19:38:01 +02:00
Jonathan A. Sternberg 1d7cda1232 controller: remove remaining parts of the controller
Removes all references to the controller and moves the remaining
sections of code to other packages.

Processes has been moved to monitor where it is used and the data
structs have been removed so buildflags is used directly. The controller
build function has been moved to the commands package.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-05 11:57:03 -05:00
CrazyMax 1383aa30c1 lint: modernize fix
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-13 20:44:57 +02:00
Nicolas De Loof c370f90b73 use filepath.IsAbs to support windows paths
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-04-22 11:37:53 +02:00
CrazyMax a91db7ccc9 bake: keep escaped interpolation in print output
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-08 17:30:24 +02:00
CrazyMax 212d598ab1 fix go.mod and lint issues
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-19 11:52:08 +01:00
Tonis Tiigi d5d3d3d502 lint: apply x/tools/modernize fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 16:37:24 -08:00
CrazyMax 4c6eba5acd bake: support += operator to append with overrides
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-04 13:29:41 +01:00
CrazyMaxandGitHub accfbf6e24 Merge pull request #2997 from jsternberg/bake-set-annotations
bake: allow annotations to be set on the command line
2025-02-20 17:53:48 +01:00
Jonathan A. Sternberg d6fdf83f45 bake: allow annotations to be set on the command line
Annotations were not merged correctly. The overrides in `ArrValue` would
be merged, but the section of code setting them from the command line
did not include `annotations` in the list of available attributes so the
command line option was completely discarded.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-02-14 11:57:30 -06:00
Tõnis TiigiandCrazyMax 0c296fe857 support for device entitlement in build and bake
Allow access to CDI Devices in Buildkit v0.20.0+ for
devices that are not automatically allowed to be used by
everyone in BuildKit configuration.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-14 11:51:47 +01:00
Tonis Tiigi f11496448a vendor: update buildkit to 0e3037c0182e
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-02-10 16:48:59 -08:00
Jonathan A. Sternberg 11c84973ef buildflags: fix ref only format for command line and bake
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-01-22 13:18:38 -06:00
CrazyMax 0d92ad713c chore: comments to not forget to update docs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-16 10:11:43 +01:00
CrazyMax 45fc5ed3b3 bake: infer git auth token from remote files to build request
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-14 15:56:11 +01:00
Tõnis TiigiandGitHub 3a0eeeacd5 Merge pull request #2863 from crazy-max/bake-fix-missing-default
bake: fix missing default target in group's default targets
2025-01-06 09:09:35 -08:00
CrazyMax b83c3e239e bake: update lookup order for override
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-06 16:19:54 +01:00
CrazyMax a90d5794ee bake: fix missing default target in group's default targets
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-06 12:53:54 +01:00
Arran Walker 5c169dd878 bake: fix context from target platform matching
Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
2024-12-20 11:42:55 +00:00
Jonathan A. Sternberg 4f81bcb5c8 bake: implement composable attributes for attestations
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-12-18 11:48:50 -06:00
Jonathan A. Sternberg 5dd4ae0335 bake: various fixes for composable attributes
This changes how the composable attributes are implemented and provides
various fixes to the first iteration.

Cache-from and cache-to now no longer print sensitive values that are
automatically added. These automatically added attributes are added when
the protobuf is created rather than at the time of parsing so they will
no longer be printed. If they are part of the original configuration
file, they will still be printed.

Empty strings will now be skipped. This was the original behavior and
composable attributes removed this functionality accidentally. This
functionality is now restored.

This also expands the available syntax that works with each of the
composable attributes. It is now possible to interleave the csv syntax
with the object syntax without any problems. The canonical form is still
the object syntax and variables are resolved according to that syntax.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-12-18 10:26:15 -06:00
Tonis Tiigi dd596d6542 bake: allow entitlements from overrides automatically
If override specifies a path, mark it automatically allowed
so there is no need to use duplicate flags for defining the
same feature.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-02 17:16:28 -08:00
Tonis Tiigi c6e403ad7f bake: fix entitlements path checks for local outputs
Previous check based on dest attributes was not correct
as the attributes already get converted before validation happens.

Because the local path is not preserved for single-file
outputs and gets replaced by io.Writer, a temporary array variable
was needed. This value should instead be added to ExportEntry
struct in BuildKit in future revision.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-02 15:00:29 -08:00
Jonathan A. Sternberg 3ccbb88e6a bake: initial set of composable bake attributes
This allows using either the csv syntax or object syntax to specify
certain attributes.

This applies to the following fields:
- output
- cache-from
- cache-to
- secret
- ssh

There are still some remaining fields to translate. Specifically
ulimits, annotations, and attest.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-11-21 12:31:11 -06:00
CrazyMax f3929447d7 fix lint issues
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-11-21 14:05:12 +01:00
Tonis TiigiandCrazyMax 9a7b028bab bake: add fs entitlements for context paths
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-21 14:05:11 +01:00
Tonis TiigiandCrazyMax 1af4f05ba4 bake: add filesystem entitlements support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-11-21 14:05:11 +01:00
Jonathan A. Sternberg a5bb117ff0 bake: improve error when using incorrect format for setting labels
Improves the error message when using an incorrect format for setting
labels. This includes the intended format directly in the error message
instead of assuming the user knows what the format is.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-11-04 14:38:23 -06:00