Set buildx as default builder#3314
Merged
thaJeztah merged 5 commits intodocker:masterfrom Feb 3, 2022
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a first part to the effort to migrate users to buildx as the default builder.
tldr;
The default experience will be the same as the current
DOCKER_BUILDKIT=1experience. This was the default experience for Docker Desktop and we are unifying the experience to be the same for Linux distributions as well.All Docker packages will contain buildx by default. The user does not need to install anything else. If a third-party package distributes CLI today without buildx, it may be necessary to update its release pipeline.
Context
There are currently four different ways that one can build locally with Docker:
DOCKER_BUILDKIT=0 docker build .DOCKER_BUILDKIT=1 docker build .docker buildx build .docker buildx create && docker buildx build .The current state not only confuses users who do not understand the differences between our build experiences, it also contradicts with where we are investing our build engineering effort: in Buildx and BuildKit.
What is buildx?
Buildx is a CLI tool that, combined with the server-side component BuildKit, provides Docker's next generation container build system. Buildx is architected so that it can work with different container runtimes through drivers. Some of the drivers (container and kubernetes) use a containerized version of BuildKit which means that the build tool chain can be updated independently of other container tooling.
Key features of buildx include:
What I did
Forward CLI build command
Docker branded build commands will by default be invoked by buildx client and go to a BuildKit based backend:
docker buildforwarded todocker buildx builddocker image buildforwarded todocker buildx builddocker builderforwarded todocker buildxRemove BuildKit implementation
DOCKER_BUILDKIT=0fallbackDefault behavior for WCOW
Missing plugin
DOCKER_BUILDKIT=1and plugin is missing or broken, cmd will fail:$ DOCKER_BUILDKIT=1 docker build . ERROR: BuildKit is enabled but the buildx component is missing or broken. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/buildx/Documentation
Update documentation:
How to verify it
$ docker buildx bake binary $ ./build/docker build .cc @tonistiigi @thaJeztah @justincormack @mikeparker @chris-crone
closes #3237
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com