← All notes

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

Sources

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

Permanent ID: iil:note:1trxwk4q

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.},
}

Markdown

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.

All artifact files (JSON index)

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.