Docker container driver: run BuildKit in a dedicated container
Answer: The docker-container driver runs BuildKit in a dedicated Docker container so you can pick a BuildKit version, build multi-arch images, and use additional cache options.
Why use this driver
The Docker container driver lets you create a managed, customizable BuildKit environment in a dedicated Docker container.
Compared with the default driver, you can specify a custom BuildKit version.
You can also build multi-arch images, as described in the QEMU section, and you get advanced options for cache import and export.
You create a builder that uses this driver with docker buildx create, and the docs show a builder named container.
Driver options
The image option sets the BuildKit image used for the container.
memory, memory-swap, cpu-quota, cpu-period, cpu-shares, cpuset-cpus, and cpuset-mems limit the container's memory and CPU.
Before you set those limits, read the Engine documentation on runtime resource constraints.
default-load is a boolean that defaults to false, and when true it automatically loads images into the Docker Engine image store.
network sets the container's network mode, and cgroup-parent defaults to /docker/buildx when Docker uses the cgroupfs driver.
restart-policy defaults to unless-stopped.
env.<key> sets an environment variable in the container.
provenance-add-gha defaults to true and writes GitHub Actions context into the builder for provenance.
When you run a build, Buildx pulls the specified image, starts the container, and submits the build to that BuildKit instance.
See also
Claims
- id: C1 claim: The driver runs a managed BuildKit environment in a dedicated Docker container. source: S1 evidence: "The Docker container driver allows creation of a managed and customizable"
- id: C2 claim: It can build multi-arch images and offers advanced cache import and export options. source: S1 evidence: "Build multi-arch images, see QEMU"
- id: C3 claim: default-load is false by default and can load images into the Engine image store. source: S2 evidence: "Automatically load images to the Docker Engine image store."
Sources
- [S1] Docker container driver. Docker, Inc.. https://docs.docker.com/build/builders/drivers/docker-container/ . License: Apache License 2.0. Accessed 2026-11-26.
- [S2] Docker container driver (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/build/builders/drivers/docker-container.md . License: Apache License 2.0. Accessed 2026-11-26.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Docker container driver; Docker, Inc., Docker container driver (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Docker container driver; Docker, Inc., Docker container driver (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker container driver: run BuildKit in a dedicated container." iinventedlight Library, iil:note:1trxwk4q, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-build-builders-drivers-docker-container/. License: CC-BY-4.0.
@misc{iil_note_1trxwk4q,
author = {{iinventedlight}},
title = {{Docker container driver: run BuildKit in a dedicated container}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/docker-build-builders-drivers-docker-container/},
note = {Permanent ID iil:note:1trxwk4q. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- docker-build-builders-drivers-docker-container.schema.json (schema; CC-BY-4.0)
- docker-build-builders-drivers-docker-container.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-build-builders-drivers-docker-container.md.