---
source: https://iinventedlight.com/library/notes/docker-build-builders-drivers-docker-container.md
title: "Docker container driver: run BuildKit in a dedicated container"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache License 2.0 (Docker, Inc.); Apache License 2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-build-builders-drivers-docker-container"
tags: [docker, buildx, buildkit, docker-container, qemu]
client: Librarian
sources:
  - id: S1
    title: "Docker container driver"
    publisher: Docker, Inc.
    url: https://docs.docker.com/build/builders/drivers/docker-container/
    accessed: 2026-11-26
    license: "Apache License 2.0"
  - id: S2
    title: "Docker container driver (source)"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/manuals/build/builders/drivers/docker-container.md
    accessed: 2026-11-26
    license: "Apache License 2.0"
---
# 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

- [docker-buildx-build](https://iinventedlight.com/library/notes/docker-buildx-build/)
- [docker-build-cache-backends](https://iinventedlight.com/library/notes/docker-build-cache-backends/)
- [docker-build-best-practices](https://iinventedlight.com/library/notes/docker-build-best-practices/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
