dockerd and DOCKER_BUILDKIT Reference
The Docker daemon and the BuildKit toggle.
dockerd is the Docker daemon that the CLI talks to. DOCKER_BUILDKIT=1 forces the classic docker build to use the BuildKit engine on setups where it is not already the default, unlocking better caching, parallelism, and Dockerfile features.
Key knobs
DOCKER_BUILDKIT=1- use BuildKit for docker build (default in modern Docker)DOCKER_BUILDKIT=0- fall back to the legacy builderDOCKER_HOST- daemon endpoint the CLI connects todockerd- start the daemon (rarely run by hand in CI)COMPOSE_DOCKER_CLI_BUILD=1- make compose build use the CLI/BuildKit
Example
shell
export DOCKER_BUILDKIT=1
docker build -t app:ci .
# Legacy builder fallback if a Dockerfile feature breaks:
DOCKER_BUILDKIT=0 docker build -t app:legacy .In CI
Most runners ship BuildKit on by default, but set DOCKER_BUILDKIT=1 explicitly to guarantee features like --mount=type=cache and heredoc Dockerfiles work. You rarely start dockerd yourself; the runner provides it. On Latchkey managed runners BuildKit is available out of the box.
Key takeaways
- DOCKER_BUILDKIT=1 forces the modern BuildKit engine for docker build.
- Set =0 to fall back to the legacy builder when a BuildKit feature misbehaves.
- DOCKER_HOST points the CLI at a specific daemon; dockerd is rarely launched by hand in CI.
Related guides
docker build Command ReferenceReference for docker build in CI: tag, file, build-arg, target, platform, no-cache, and pull flags for buildi…
docker buildx build Command ReferenceReference for docker buildx build in CI: --push, --cache-from, --cache-to type=gha, and multi-arch --platform…
docker context Command ReferenceReference for docker context in CI: create, list, and switch Docker endpoints to target a remote daemon over…