Kurtosis docker-local-build
Build and test Kurtosis from source on local Docker. Compiles all components (engine, core, files-artifacts-expander), builds Docker images, installs the CLI, and restarts the engine. Use when developing Kurtosis and testing changes locally with Docker.
git clone https://github.com/kurtosis-tech/kurtosis
T=$(mktemp -d) && git clone --depth=1 https://github.com/kurtosis-tech/kurtosis "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/docker-local-build" ~/.claude/skills/kurtosis-tech-kurtosis-docker-local-build && rm -rf "$T"
skills/docker-local-build/SKILL.mdDocker Local Build
Build all Kurtosis components from source and test them locally on Docker.
Overview
This skill builds the full Kurtosis stack for local Docker testing:
- Engine — Docker image
kurtosistech/engine - Core (APIC) — Docker image
kurtosistech/core - Files Artifacts Expander — Docker image
kurtosistech/files-artifacts-expander - CLI — binary at
, installed to.tmp/kurtosis/usr/local/bin/kurtosis
All images are tagged with the current git short SHA (+
-dirty if uncommitted changes exist) via scripts/get-docker-tag.sh. The same tag is compiled into the CLI as KurtosisVersion.
Quick build (recommended)
Run the wrapper script from the repo root. It handles version generation, image builds, CLI compilation, installation, and engine reset:
./scripts/local-build.sh
Environment variables
| Variable | Default | Description |
|---|---|---|
| | Where to install the CLI binary |
| | Set to to skip Docker image builds (CLI only) |
| | Build debug images with delve debugger |
| | Use podman instead of docker |
| | Stop engine and clean containers after build |
Examples
# Full build + install + reset ./scripts/local-build.sh # CLI only (skip image builds) BUILD_IMAGES=false ./scripts/local-build.sh # Build with debug images DEBUG_IMAGE=true ./scripts/local-build.sh # Install to a custom path INSTALL_PATH=/tmp/kurtosis ./scripts/local-build.sh # Skip engine reset (keep running enclaves) RESET_KURTOSIS_AFTER_BUILD=false ./scripts/local-build.sh
Manual build (step by step)
1. Generate version constants
./scripts/generate-kurtosis-version.sh
This writes the git-based version tag into
kurtosis_version/kurtosis_version.go.
2. Build Docker images
The existing build scripts handle binary compilation, unit tests, and Docker image building:
# Build engine image (compiles binary, runs tests, builds Docker image) ./engine/scripts/build.sh # Build core + files-artifacts-expander images ./core/scripts/build.sh
These scripts:
- Detect the host architecture (amd64/arm64)
- Cross-compile the Go binary for linux
- Run unit tests
- Build a Docker image tagged
kurtosistech/<component>:<git-sha> - Use
which creates a buildx builder, builds for the local platform withscripts/docker-image-builder.sh
, and cleans up--load
3. Build the CLI
go build -o .tmp/kurtosis ./cli/cli/
4. Install
cp .tmp/kurtosis /usr/local/bin/kurtosis
5. Reset the engine
kurtosis engine stop || true docker ps -aq --filter "label=com.kurtosistech.app-id=kurtosis" | xargs -r docker rm -f docker ps -aq --filter "name=kurtosis-engine" | xargs -r docker rm -f docker ps -aq --filter "name=kurtosis-reverse-proxy" | xargs -r docker rm -f docker ps -aq --filter "name=kurtosis-logs-collector" | xargs -r docker rm -f docker ps -aq --filter "name=kurtosis-api--" | xargs -r docker rm -f
6. Start and test
kurtosis engine start kurtosis run github.com/ethpandaops/ethereum-package kurtosis clean -a
Key files
| Component | Source | Dockerfile | Image |
|---|---|---|---|
| Engine | | | |
| Core (APIC) | | | |
| Files Artifacts Expander | | | |
| CLI | | N/A | N/A |
| Version | | N/A | N/A |
| Version generator | | N/A | N/A |
| Docker tag | | N/A | N/A |
| Image builder | | N/A | N/A |
Iterating
After making code changes:
- Re-run
(or set./scripts/local-build.sh
if only CLI changed)BUILD_IMAGES=false - The version tag changes automatically with each commit (SHA-based)
- If you have uncommitted changes, the tag gets a
suffix-dirty
Common issues
| Symptom | Fix |
|---|---|
fails with import errors | Run in the failing module directory |
Docker build fails with error | Ensure exists in the component's server directory |
| Engine starts but uses old images | The tag is SHA-based; make sure the built image tag matches output |
warning | Normal when building without enclave-manager; an empty placeholder is created automatically |
| buildx builder conflict | Remove stale builders: and |
| Version mismatch between CLI and engine | Rebuild everything from the same commit; version is compiled into the CLI binary |