Commit Graph
3299 Commits
Author SHA1 Message Date
Tõnis TiigiandGitHub 1e969978aa Merge pull request #3234 from crazy-max/bake-add-host
bake: extra-hosts support
2025-06-11 12:50:34 -07: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
Tõnis TiigiandGitHub 1b4bd20e6f Merge pull request #3233 from tonistiigi/imagetools-registrytoken
imagetools: support registrytoken auth in docker config
2025-06-11 09:07:19 -07:00
Tonis Tiigi da426ecd3a imagetools: support registrytoken auth in docker config
This is not supported by the Authorizer from containerd and
needs to be added manually. Build authentication happens through
BuildKit session that already supports this.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-06-10 23:20:08 -07:00
Tonis Tiigi 10618d4c73 imagetools: move auth function to separate file
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-06-10 22:04:56 -07:00
Tõnis TiigiandGitHub 52b5d0862f Merge pull request #3224 from jsternberg/evaluate-handler
build: change build handler to evaluate instead of onresult
2025-06-10 11:07:31 -07:00
Tõnis TiigiandGitHub d1e22e5fc3 Merge pull request #3228 from tonistiigi/hack-link-gold
lint: fix linter error on arm64
2025-06-10 10:37:36 -07:00
Jonathan A. Sternberg 38cf84346c build: change build handler to evaluate instead of onresult
This changes the build handler to customize the behavior of evaluate
rather than onresult and also simplifies the `ResultHandle`. The
`ResultHandle` is now only valid within the gateway callback and can be
used to start containers from the handler.

`Evaluate` now executes inside of the gateway callback rather than
having a separate implementation that executes or re-invokes the build.
This keeps the gateway callback session open until the debugger has
returned.

The `ErrReload` for monitor has now been moved into the `build` package
and been renamed to `ErrRestart`. This is because it restarts the build
so the name makes a bit more sense. The actual use of this functionality
is still tied to the monitor reload.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-10 11:48:41 -05:00
Jonathan A. Sternberg 34e59ca1bd progress: fix progress writer pause and unpause to prevent panics
This changes the progress printer's pause and unpause implementation to
be reentrant to prevent race conditions and it also allows the status
updates to be buffered when the display is paused.

The previous implementation mixed the pause implementation with the
finish implementation and could cause a send on closed channel panic
because it could close the status channel before it had finished being
used. Now, the status channel is not closed.

When the display is enabled, the status channel will be forwarded to an
internal channel that is used to display the updates. When the display
is paused, the status channel will have the statuses buffered in memory
to be sent when the progress display is resumed.

The `Unpause` method has also been renamed to `Resume`.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-09 14:07:52 -05:00
Tonis Tiigi 2706e2f429 lint: fix linter error on arm64
Something has changed in golang or alpine requiring gold linker by
default. In future this could be updated to clang/lld instead, eg.
by just calling xx.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-06-09 10:59:23 -07:00
Tõnis TiigiandGitHub 02ab492cac Merge pull request #3226 from ArthurFlag/ENGDOCS-2699-build-list-and-explain-accepted-schemes
docs: restructure examples for context
2025-06-06 11:54:37 -07:00
Tõnis TiigiandGitHub b8d8c7b1a6 Merge pull request #3227 from crazy-max/hcl-merge-tests
bake: hcl merged tests
2025-06-06 11:52:59 -07:00
ArthurFlag dc6ec35e1d docs: restructure examples for context
Signed-off-by: ArthurFlag <arthur.flageul@docker.com>
2025-06-06 17:22:22 +02:00
CrazyMax 3f49ee5a90 bake: hcl merged tests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-06 17:16:56 +02:00
Tõnis TiigiandGitHub c45185fde0 Merge pull request #3222 from jsternberg/controller-remove-final
controller: remove remaining parts of the controller
2025-06-05 10:18:40 -07: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
Tõnis TiigiandGitHub fb916a960c Merge pull request #3214 from tonistiigi/internal-codes
cmd: custom exit codes for internal, resource and canceled errors
2025-06-05 09:11:19 -07:00
Tõnis TiigiandGitHub 60b1eda2df Merge pull request #3220 from jsternberg/monitor-driven-build
monitor: move remaining controller functionality into monitor
2025-06-04 13:50:24 -07:00
Jonathan A. Sternberg 8f2604b6b4 monitor: move remaining controller functionality into monitor
This creates a `Monitor` type that keeps the global state between
monitor invocations and allows the monitor to exist during the build so
it can be utilized for callbacks.

The result handler is now registered with the monitor during the build
and `Run` will use the result if it is present and the configuration
intends the monitor to be invoked with the given result.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-04 15:27:24 -05:00
Tõnis TiigiandGitHub bb5b5e37e8 Merge pull request #3219 from jsternberg/monitor-reload-refactor
monitor: refactor how reload works
2025-06-04 13:26:48 -07:00
Jonathan A. Sternberg 21ebf82c99 monitor: refactor how reload works
The build now happens in a loop and the monitor is run after every
build. The monitor can return `ErrReload` to signal to the main thread
that it should reload the build result.

This will be used in the future to move the monitor into a callback
rather than as a separate existence. It allows the monitor to not
control the build itself which now makes it possible to completely
remove the controller.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-04 15:06:31 -05:00
Tõnis TiigiandGitHub d61853bbb3 Merge pull request #3213 from jsternberg/build-refactors
build: refactor some of the build functions into smaller utility functions
2025-06-03 14:43:26 -07:00
Jonathan A. Sternberg 65e46cc6af commands: simplify passing stdin to the build when the monitor is configured
The monitor needs stdin to run and isn't compatible with loading a
context or dockerfile from stdin. We already disallow this combination
and, with the removal of the remote controller, there's no way to use
stdin during the build when invoke is configured.

This just removes the extra code to allow forwarding stdin to the build
when the monitor is configured to simplify that section of code.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-03 15:41:23 -05:00
Jonathan A. Sternberg 6a0f5610e3 controller: remove the controller interface
The controller interface is removed and the local controller is used for
only the initial build, invoke, and rebuilds.

Process control has been moved to the monitor.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-03 15:41:23 -05:00
Jonathan A. Sternberg e78aa98c92 build: refactor some of the build functions into smaller utility functions
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-03 15:41:22 -05:00
CrazyMaxandGitHub e6ff731323 Merge pull request #3216 from jsternberg/keep-storage-deprecation-notice
commands: update deprecation notice for keep-storage
2025-06-02 16:58:58 +02:00
Jonathan A. Sternberg 9bd1ba2f5c commands: update deprecation notice for keep-storage
The `--keep-storage` flag was changed to `--reserved-space`. Before it was
changed to that name, it was changed to `--max-storage`. This flag never
made it into a release as the name was changed before release, but the
update to the flag in buildx forgot to update the deprecation notice.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-06-02 09:35:39 -05:00
CrazyMaxandGitHub f90170965a Merge pull request #3207 from rrjjvv/show-var-types
Show types during variable list operation
2025-06-02 09:09:18 +02:00
Tonis Tiigi b3e37e899f cmd: custom exit codes for internal, resource and canceled errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-30 11:12:24 -07:00
Tõnis TiigiandGitHub a04b7d8689 Merge pull request #3212 from thaJeztah/bump_engine
vendor: github.com/docker/docker, docker/cli v28.2.2
2025-05-30 10:49:29 -07:00
Tõnis TiigiandGitHub 52bf4bf7ce Merge pull request #3210 from thaJeztah/dockerfile_bump_docker
Dockerfile: update to docker v28.2.2
2025-05-30 10:49:08 -07:00
Sebastiaan van Stijn 13031cc2ca vendor: github.com/docker/docker, docker/cli v28.2.2
no changes in vendored file, just version update

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 17:30:09 +02:00
Sebastiaan van Stijn 46fae59e2e Dockerfile: update to docker v28.2.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 17:24:23 +02:00
Roberto Villarreal b40b2caf1a Show types during variable list operation
If a type was explicitly provided, it will be displayed in the variable
listing.  Inferred type names are not displayed, as they likely would
not match the user's intent.

Previously only `string` and `bool` default values were displayed in the
 listing.  All default values, regardless of type, are now displayed.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-29 17:36:46 -06:00
Tõnis TiigiandGitHub 1436f93aa1 Merge pull request #3194 from thaJeztah/bump_engine
vendor: github.com/docker/docker, github.com/docker/cli v28.2.1
2025-05-29 16:05:26 -07:00
Sebastiaan van Stijn 99d82e6cea vendor: github.com/docker/cli v28.2.1
full diff: https://github.com/docker/cli/compare/v28.1.1...v28.2.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-29 09:36:54 +02:00
Sebastiaan van Stijn bc620fcc71 vendor: github.com/docker/docker v28.2.1
full diff: https://github.com/docker/docker/compare/v28.1.1...v28.2.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-29 09:34:27 +02:00
CrazyMaxandGitHub e3c6618db2 Merge pull request #3201 from jsternberg/remove-generated-files
hack: remove code generation related to generated files
2025-05-23 11:14:45 +02:00
Tõnis TiigiandGitHub 542bda49f2 Merge pull request #3188 from crazy-max/buildkit-0.22
dockerfile: update buildkit to 0.22.0
2025-05-22 15:33:45 -07:00
Jonathan A. Sternberg 781a3f117a hack: remove code generation related to generated files
With the removal of the protobuf for the controller, there are no longer
any generated files. Remove the makefile targets and the associated
dockerfiles and bake targets.

This wasn't being included in CI because it wasn't part of the
`validate` target.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-05-22 14:59:42 -05:00
CrazyMax 614cc880dd dockerfile: update buildkit to 0.22.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-21 16:55:34 +02:00
CrazyMaxandGitHub dfad6e0b1f Merge pull request #3189 from rrjjvv/var-typing-docs
Add variable typing to reference docs
2025-05-21 16:34:59 +02:00
CrazyMaxandGitHub 776dbd4086 Merge pull request #3198 from rrjjvv/var-typing-no-value-fix
Consider typed, value-less variables to have `null` value
2025-05-21 16:34:42 +02:00
Tõnis TiigiandGitHub 75f1d5e26b Merge pull request #3199 from crazy-max/buildkit-0.22.0
vendor: github.com/moby/buildkit v0.22.0
2025-05-21 07:26:25 -07:00
CrazyMax 291c353575 bake: TestEmptyVariable
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-21 16:15:30 +02:00
CrazyMax a11bb4985c vendor: github.com/moby/buildkit v0.22.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-21 14:57:25 +02:00
Roberto Villarreal cfeca919a9 Add variable typing to reference docs
This documents the variable typing introduced in #3167.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-20 13:49:27 -06:00
Roberto Villarreal 3c0f5c5c21 Consider typed, value-less variables to have null value
A variable with a type but no default value or override resulted in an
empty string.  This matches the legacy behavior of untyped variables,
but does not make sense when using types (an empty string is itself a
type violation for everything except `string`).  All variables defined
with a type but with no value are now a typed `null`.

A variable explicitly typed `any` was previously treated as if the
typing was omitted; with no defined value or override, that resulted in
an empty string.  The `any` type is now distinguished from an omitted
type; these variables, with no default or override, are also `null`.

In other respects, the behavior of `any` is unchanged and largely
behaves as if the type was omitted.  It's not clear whether it should be
 supported, let alone how it should behave, so these tests were removed.
It's being treated as undefined behavior.

Signed-off-by: Roberto Villarreal <rrjjvv@yahoo.com>
2025-05-20 13:09:13 -06:00
CrazyMaxandGitHub ea2b7020a4 Merge pull request #3193 from crazy-max/buildkit-0.22.0-rc2
vendor: github.com/moby/buildkit v0.22.0-rc2
2025-05-19 17:29:11 +02:00
CrazyMax 5ba7d7eb4f vendor: github.com/moby/buildkit v0.22.0-rc2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-19 17:14:59 +02:00