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
[epic] make BuildKit the default builder on Linux #40379
Comments
Maybe we can start with adding "BuildKit ad" message to the legacy |
✅ |
The leftover items listed here are in 3 big categories. WCOW support, setting cgroups per build request and debugging with intermediate images. WCOW - I don't think anyone is actively working on it. There has been some interest in the community (moby/buildkit#1314 ) and MSFT but no actual code to get over the first roadblocks, eg. containerd/containerd#2366 for completing snapshot API in containerd so it has feature parity with what Docker graphdrivers can do. Cgroups flags ( For intermediate images, we do not plan to support them because of performance and storage management issues. We do want to replace this with a builtin debug capabilities that would be much helpful than messing with intermediate images anyway. Two other important considerations: BuildKit was always designed with a dependency on the containerd storage libraries, and they have still not been merged to Moby. This means that the current implementation is incomplete and uses hacky adapters to mock some containerd features with older Moby libraries. Things that do not work in Moby are multi-platform images support, remote cache export from cache manifest in the registry, remote cache from client-side files, some exporters (eg. oci, registry). The instruction cache chain is a bit different for images in Moby because we can't access the digest of the image manifest. Making it default before finishing the containerd work does look like cutting corners with a lower quality end product. The other aspect is that I think the default build experience in Docker shouldn't be equivalent to |
This is going to cause lots of pain, lots of projects use the trick of accessing hosts during docker build time in order to run database tests , use apt-cache to speed up dependency fetching, and lots of other things. You can't do this without running a custom network. |
Added #40887 to the top description |
it was the default on my mac now.. |
I really appreciate the Docker team being so careful during this migration to BuildKit. I'm sure supporting both build systems has a significant maintenance cost. |
Is there a reliable way to detect if BuildKit is active? Since building an image that requires it for mounting build cache on Please let me know if I should create a new issue/ask elsewhere for that topic, but I thought this question could be relevant for this topic and I didn't find any answers/similar questions when searching. |
BuildKit is an enhanced build engine for Docker that will eventually become the default. See moby/moby#40379.
These are currently blockers for me; I need build time networking to work in docker-compose. There's a bunch of complexity around why some of us need networks besides node, host, and default attached to a container that's building (defined in a docker-compose.yml in my case). |
As of v23.0.0 BuildKit is the default builder on Linux. |
Is there a good way to disable it (since it's not compatible with all existing use cases) through the command line? |
I discovered |
@dboreham Would you mind posting a repro with a Dockerfile and build command so we can look at your issue with BuildKit? |
It turned out to be this issue: docker/buildx#1832 |
fwiw I have also had problems in the past with BuildKit on ARM, I think to do with the container images it depends on (BuildKit's images) not published for that arch. I can try to reproduce that one again if you're interested. |
If you're talking about the container builder, here is the list of supported platforms: https://github.com/moby/buildkit/blob/db6342f9fa9b69d0da517d776e619b8de221de2f/.github/workflows/buildkit.yml#L28 For the Dockerfile frontend it's here: https://github.com/moby/buildkit/blob/db6342f9fa9b69d0da517d776e619b8de221de2f/.github/workflows/frontend.yml#L26 Wonder if in your case
@thaJeztah If you want to update issue description with: https://docs.docker.com/build/cache/garbage-collection/ |
My point isn't that it is difficult to disable, just that BuiltKit should support build-time networking (not sure of the official term, but that's how I refer to moby's fuctionality allowing networking during builds, using compose especially). |
Agreed @bryanhuntesl |
Not parent, but the approach we've taken in my team is to simply disable buildkit. So now we get to see a loud warning telling us how stupid we are for not using buildkit, but at least our product still works. I'm assuming that eventually either buildkit will be fixed to have feature parity with "docker classic", or one of the open source clones/forks of docker will emerge as a usable alternative. |
I would hate for my build system to become entrenched with deprecated mechanisms. How many people with complex container systems or proxies for anything public facing use |
BuildKit is planned to replace the classic builder and has been available as an opt-in feature since Docker 18.06. BuildKit provides many enhancements over the classic builder, fixes bugs that cannot be fixed (or cannot easily be fixed) in the classic builder, and is overall recommended to be used if supported on the user's platform.
So far, BuildKit was still opt-in, which makes it harder to use (not all users are even aware of the new builder), but also inconsistent with our recommendation.
I'm opening this issue to discuss the option to make BuildKit the default builder in the next (docker) release.
Proposal: make BuildKit the default builder on Linux
DOCKER_BUILDKIT=0
or the equivalentdaemon.json
configuration)Why BuildKit is not yet the default?
We made BuildKit an opt-in feature get a wider audience for testing the new builder in many scenarios, allowing us to catch important regressions without breaking existing users. While stability and regressions have been addressed, and we're confident that BuildKit is a good replacement for most scenarios, there were still some things left to be done:
Even though both of the above still hold true, I think it makes sense to switch BuildKit to be the default:
Prerequisites
Feature parity: (advanced) options supported by BuildKit
Note: I also added a
area/feature-parity
label in the BuildKit repository to make it easier to find issues and pull requests related to feature-parity with the classic builder;https://github.com/moby/buildkit/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Ffeature-parity
stderr
instead ofstdout
(see [RFC] Add some output to logs for backward compat buildkit#1155). This is a bugfix / by design, but is a change in behavior that should be called out (changelog?)Successfully built
,Successfully tagged
output ([RFC] Add some output to logs for backward compat buildkit#1155)List of options, and their status in BuildKit
Note that the current CLI always shows all options (even if not supported), but docker/cli#2123 added annotations to hide unsupported options (currently only on master)
Looking at these options:
DOCKER_BUILDKIT=0
, or disabling BuildKit to be the default in the daemon configuration--add-host
--build-arg
--cache-from
--cgroup-parent
--cpu-period
--cpu-quota
-c, --cpu-shares
--cpuset-cpus
--cpuset-mems
--disable-content-trust
-f, --file
--force-rm
--iidfile
--isolation
--label
-m, --memory
--memory-swap
--network
none
andhost
, but no custom networks see moby/buildkit#978--no-cache
-o, --output
--platform
--progress
--pull
-q, --quiet
--rm
--secret
--security-opt
--shm-size
--squash
DOCKER_BUILDKIT=1 docker build --squash
should not squash the base image #38903.This feature is still "experimental" so should not be a blocker
--ssh
-t, --tag
--target
--ulimit
The text was updated successfully, but these errors were encountered: