# dockerd and DOCKER_BUILDKIT Reference

> Reference for the dockerd daemon and the DOCKER_BUILDKIT environment variable in CI: enable BuildKit, control the daemon, and tune the build engine.

Source: https://latchkey.dev/learn/command-reference/dockerd-buildkit-env-command-reference  
Updated: 2026-06-26

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 builder
- `DOCKER_HOST` - daemon endpoint the CLI connects to
- `dockerd` - 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.

## FAQ

### dockerd and DOCKER_BUILDKIT Reference?

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.

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

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
