# docker buildx bake: Build Multiple Targets from a File

> How docker buildx bake works: building multiple images from an HCL/JSON bake file, target groups, variables, and CI use.

Source: https://latchkey.dev/learn/command-reference/docker-buildx-bake-command  
Updated: 2026-06-25

Build many images at once from a declarative bake file.

docker buildx bake builds one or more targets defined in an HCL, JSON, or compose file. This page covers the bake file, target groups, and overrides in CI.

## What it does

bake reads a docker-bake.hcl (or compose/JSON) file describing named build targets and groups, then builds them with BuildKit - often in parallel. It is how you express a fleet of images declaratively instead of many build commands.

## Common usage

```Terminal
docker buildx bake
docker buildx bake api worker            # specific targets
docker buildx bake --set *.platform=linux/amd64,linux/arm64
docker buildx bake -f docker-bake.hcl --push
```

## Common errors in CI

"failed to find target X" means the name is not defined in the bake file or referenced group - check the target/group blocks. "no bake definition found" means there is no docker-bake.hcl/json or compose file in the directory; pass -f. Override values per target with --set target.key=value (e.g. tags or platform) rather than editing the file in CI.

## FAQ

### docker buildx bake: Build Multiple Targets from a File?

docker buildx bake builds one or more targets defined in an HCL, JSON, or compose file. This page covers the bake file, target groups, and overrides in CI.

### What it does?

bake reads a docker-bake.hcl (or compose/JSON) file describing named build targets and groups, then builds them with BuildKit - often in parallel. It is how you express a fleet of images declaratively instead of many build commands.

### Common errors in CI?

"failed to find target X" means the name is not defined in the bake file or referenced group - check the target/group blocks. "no bake definition found" means there is no docker-bake.hcl/json or compose file in the directory; pass -f. Override values per target with --set target.key=value (e.g.

---

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
