Buildkit
concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
Install / Use
/learn @moby/BuildkitREADME
BuildKit <!-- omit in toc -->
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 https://github.com/moby/moby/issues/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.
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->[!NOTE]
docker builduses 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.
- Used by
- Quick start
- Cache
- Metadata
- Systemd socket activation
- Expose BuildKit as a TCP service
- Containerizing BuildKit
- OpenTelemetry support
- Running BuildKit without root privileges
- Building multi-platform images
- Contributing
Used by
BuildKit is used by the following projects:
- Moby & Docker (
DOCKER_BUILDKIT=1 docker build) - img
- OpenFaaS Cloud
- container build interface
- Tekton Pipelines (formerly Knative Build Templates)
- the Sanic build tool
- vab
- Rio
- kim
- PouchContainer
- Docker buildx
- Okteto Cloud
- Earthly earthfiles
- Gitpod
- Dagger
- envd
- Depot
- Namespace
- Unikraft
- DevZero
- dacc
Quick start
:information_source: For Kubernetes deployments, see examples/kubernetes.
BuildKit is composed of the buildkitd daemon and the buildctl client.
While the buildctl client is available for Linux, macOS, and Windows, the buildkitd daemon is only available for Linux and *Windows currently.
The latest binaries of BuildKit are available here for Linux, macOS, and Windows.
Linux Setup
The buildkitd daemon requires the following components to be installed:
- runc or crun
- containerd (if you want to use containerd worker)
Starting the buildkitd daemon:
You need to run buildkitd as the root user on the host.
$ sudo buildkitd
To run buildkitd as a non-root user, see docs/rootless.md.
The buildkitd daemon supports two worker backends: OCI (runc) and containerd.
By default, the OCI (runc) worker is used. You can set --oci-worker=false --containerd-worker=true to use the containerd worker.
We are open to adding more backends.
To start the buildkitd daemon using systemd socket activation, you can install the buildkit systemd unit files. See Systemd socket activation
The buildkitd daemon listens gRPC API on /run/buildkit/buildkitd.sock by default, but you can also use TCP sockets.
See Expose BuildKit as a TCP service.
Windows Setup
See instructions and notes at docs/windows.md.
macOS Setup
Homebrew formula (unofficial) is available for macOS.
$ brew install buildkit
The Homebrew formula does not contain the daemon (buildkitd).
For example, Lima can be used for launching the daemon inside a Linux VM.
brew install lima
limactl start template://buildkit
export BUILDKIT_HOST="unix://$HOME/.lima/buildkit/sock/buildkitd.sock"
Build from source
To build BuildKit from source, see .github/CONTRIBUTING.md.
For a buildctl reference, see this document.
Exploring LLB
BuildKit builds are based on a binary intermediate format called LLB that is used for defining the dependency graph for processes running part of your build. tl;dr: LLB is to Dockerfile what LLVM IR is to C.
- Marshaled as Protobuf messages
- Concurrently executable
- Efficiently cacheable
- Vendor-neutral (i.e. non-Dockerfile languages can be easily implemented)
See solver/pb/ops.proto for the format definition, and see ./examples/README.md for example LLB applications.
Currently, the following high-level languages have been implemented for LLB:
- Dockerfile (See Exploring Dockerfiles)
- Buildpacks
- Mockerfile
- Gockerfile
- bldr (Pkgfile)
- HLB
- Earthfile (Earthly)
- Cargo Wharf (Rust)
- Nix
- mopy (Python)
- envd (starlark)
- Blubber
- Bass
- kraft.yaml (Unikraft)
- r2d4/llb (JSON Gateway)
- Massé
- DALEC
- (open a PR to add your own language)
Exp
Related Skills
node-connect
336.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
336.2kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
prose
336.2kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
frontend-design
82.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

