Loading...
Loading...
Configures and runs Depot remote container builds using `depot build` and `depot bake`. Use when building Docker images, creating Dockerfiles with Depot, pushing images to registries, building multi-platform/multi-arch images (linux/amd64, linux/arm64), debugging container build failures, optimizing Dockerfile layer caching, using docker-bake.hcl or docker-compose builds, or migrating from `docker build` / `docker buildx build` to Depot. Also use when the user mentions depot build, depot bake, container builds, image builds, or asks about Depot's build cache, build parallelism, or ephemeral registry.
npx skill4agent add depot/skills depot-container-buildsdepot builddocker builddocker buildx builddepot bakedocker buildx bake--load--push--savedepot build# Build remotely (image stays in remote cache)
depot build -t repo/image:tag .
# Build + download to local Docker daemon
depot build -t repo/image:tag . --load
# Build + push directly to registry (fast — doesn't route through local network)
depot build -t repo/image:tag . --push
# Multi-platform build (native CPUs, no emulation)
depot build --platform linux/amd64,linux/arm64 -t repo/image:tag . --push
# Save to Depot ephemeral registry (default 7-day retention)
depot build --save .
depot build --save --save-tag my-tag .
# Suppress provenance metadata (fixes "unknown/unknown" platform in registries)
depot build -t repo/image:tag --push --provenance=false .
# Lint Dockerfile before building
depot build -t repo/image:tag . --lint
# Build with secrets
depot build --secret id=mysecret,src=./secret.txt -t repo/image:tag .
# Build with SSH forwarding
depot build --ssh default -t repo/image:tag .
# Specify a Depot project explicitly
depot build --project <project-id> -t repo/image:tag .| Flag | Description |
|---|---|
| Download image to local Docker daemon |
| Push to registry |
| Save to Depot ephemeral registry |
| Custom tag for Depot Registry |
| Target platforms ( |
| Force build to run on specific arch ( |
| Depot project ID |
| Depot API token |
| Lint Dockerfile before build |
| Control provenance attestation (set |
| Disable cache for this build |
| Path to Dockerfile |
| Image name and tag |
| Build specific stage |
| Set build-time variables |
| Expose secrets ( |
| Expose SSH agent |
| Custom output ( |
depot bakedocker buildx bakedepot bake # Default file lookup
depot bake -f docker-bake.hcl # Specific HCL file
depot bake -f docker-compose.yml --load # Build compose services + load locally
depot bake --save --save-tag myrepo/app:v1 # Save to Depot Registry
depot bake --print # Print resolved config without buildingvariable "TAG" {
default = "latest"
}
group "default" {
targets = ["app", "worker"]
}
target "app" {
dockerfile = "Dockerfile"
platforms = ["linux/amd64", "linux/arm64"]
tags = ["myrepo/app:${TAG}"]
args = { NODE_VERSION = "20" }
}
target "worker" {
dockerfile = "Dockerfile.worker"
tags = ["myrepo/worker:${TAG}"]
contexts = { app = "target:app" } # Share base between targets
}TAG=v2.0 depot bakeservices:
api:
build:
dockerfile: ./Dockerfile.api
x-depot:
project-id: abc123
web:
build:
dockerfile: ./Dockerfile.web
x-depot:
project-id: def456# Preferred: build all services in parallel, then load
depot bake -f docker-compose.yml --load
docker compose up
# Alternative: zero code change (less efficient, each service = separate build)
depot configure-docker
docker compose build# docker build → depot build (same flags, one-line swap)
depot build -t my-image .
# docker buildx bake → depot bake
depot bake -f docker-bake.hcl
# Zero code change via Docker plugin
depot configure-docker
docker build . # Routes through Depot (look for [depot] prefix in logs)--cache-from type=gha--cache-to type=gha| Mistake | Fix |
|---|---|
Using | Remove them. Depot caches automatically on NVMe SSDs. |
Multi-platform image shows | Add |
Expecting image locally after | Add |
| Add |
| Build hangs or "failed to mount" errors | Reset cache in project settings or via |
| "401 Unauthorized" pulling base images | Docker Hub rate limit — authenticate with |
| "Keep alive ping failed" / OOM | Scale up builder size in project settings or enable autoscaling |
| Size | CPUs | RAM | Per-Minute | Plans |
|---|---|---|---|---|
| Default | 16 | 32 GB | $0.004 | All |
| Large | 32 | 64 GB | $0.008 | Startup+ |
| Extra Large | 64 | 128 GB | $0.016 | Startup+ |
# Save image to Depot Registry
depot build --save -t myapp .
# Pull a saved image
depot pull --project <id> <build-id>
# Push saved image to another registry
depot push --project <id> -t registry/image:tag <build-id>
# Docker auth for Depot Registry
docker login registry.depot.dev -u x-token -p <depot-token>
# Registry URL: registry.depot.dev/<project-id>:<tag># estargz (lazy-pulling for faster container startup)
depot build --output "type=image,name=repo/image:tag,push=true,compression=estargz,oci-mediatypes=true,force-compression=true" .
# zstd compression (faster Fargate/K8s startup)
depot build --output type=image,name=repo/image:tag,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true,push=true .