Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: don't hardcode classic builder for windows daemons #5001

Open
thaJeztah opened this issue Apr 10, 2024 · 1 comment
Open

build: don't hardcode classic builder for windows daemons #5001

thaJeztah opened this issue Apr 10, 2024 · 1 comment

Comments

@thaJeztah
Copy link
Member

Description

relates to:

When support for BuildKit was removed from the CLI (using Buildx instead), we implemented logic to detect whether BuildKit or the classic builder should be used. As Windows did not support BuildKit, the CLI was hard-coded to use the classic builder in Windows binaries (with an option to force using buildx when using docker buildx install).

While current versions of the Docker Engine do not yet support BuildKit on Windows, work is in progress to add support for it, and BuildKit 0.13 has experimental support for Windows.

The daemon provides a BuilderVersion field as part of the /_ping response to advertise the suggested version of the Builder to use. Currently that is 2 (BuildKit) on Linux, and 1 (classic builder) on Windows;

curl -I --unix-socket /var/run/docker.sock http://localhost/_ping
HTTP/1.1 200 OK
Api-Version: 1.45
Builder-Version: 2
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: text/plain; charset=utf-8
Date: Wed, 10 Apr 2024 09:11:20 GMT
Docker-Experimental: false
Ostype: linux
Pragma: no-cache
Server: Docker/26.0.0 (linux)
Swarm: active/manager

While that information must be considered a recommendation (the client is still allowed to opt-in/opt-out), we should use this information as part of the logic in the CLI to decide whether BuildKit or the legacy builder should be used, so that the CLI can be used with a Windows daemon that has experimental support for BuildKit enabled would automatically use BuildKit without changes in the CLI's configuration.

Note that, for this to be functional, a Windows Buildx binary (CLI-plugin) must be present; similar to how this is needed on Linux.

@thaJeztah thaJeztah changed the title build: don't hardcode classic builder for windows binaries build: don't hardcode classic builder for windows daemons Apr 10, 2024
@thaJeztah
Copy link
Member Author

Just adding here, as I'm not sure now if it was hard-coded for Windows CLI or if the CLI is connected to a Windows daemon (in either case, the logic should look at what the daemon supports, and not based on platform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant