BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner.
Key features:
- Automatic garbage collection
- Extendable frontend formats
- Concurrent dependency resolution
- Efficient instruction caching
- Build cache import/export
- Nested build job invocations
- Distributable workers
- Multiple output formats
- Pluggable architecture
- Execution without root privileges
Read the proposal from moby/moby#32925
Introductory blog post https://blog.mobyproject.org/introducing-buildkit-17e056cc5317
Join #buildkit
channel on Docker Community Slack
Note
If you are visiting this repo for the usage of BuildKit-only Dockerfile features
like RUN --mount=type=(bind|cache|tmpfs|secret|ssh)
, please refer to the
Dockerfile reference.
Note
docker build
uses Buildx and BuildKit by default since Docker Engine 23.0.
You don't need to read this document unless you want to use the full-featured
standalone version of BuildKit.
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name mybuild --driver-opt image=ghcr.io/loong64/buildkit:buildx-stable-1
docker buildx inspect --bootstrap --builder mybuild