Build
The /cc-deck.build command generates a Containerfile from your manifest and builds the container image.
If the build fails, it analyzes the error, fixes the Containerfile, and retries automatically.
Prerequisites
Before running the build command:
-
Cross-compile the cc-deck binary for the target platforms:
# From the cc-deck source repo make cross-cli -
Copy the binaries to your build directory:
cp cc-deck/cc-deck-linux-* /path/to/my-image/.build-context/
Or use the one-step make test-image which does both.
What Happens
-
Manifest validation: Checks that
cc-deck-build.yamlhas the required fields -
Containerfile generation: Resolves free-form tool descriptions to concrete install commands
-
Existing file check: If a Containerfile exists, shows a diff and asks whether to use the new or existing version
-
Build: Runs the container build with a 10-minute timeout
-
Self-correction: If the build fails, analyzes the error, fixes the Containerfile, and retries (up to 3 times)
-
build.sh generation: Creates a shell script for rebuilding without Claude Code
Multi-Architecture
By default, images are built for both linux/arm64 and linux/amd64.
You can override this in your input:
/cc-deck.build for linux/arm64 only
The Containerfile uses ${TARGETARCH} for architecture-dependent downloads, and the cc-deck binary is copied per-architecture from .build-context/cc-deck-linux-${TARGETARCH}.
Self-Correction
When a build step fails, Claude Code:
-
Reads the error output
-
Identifies the failing step
-
Diagnoses the root cause (wrong package name, download URL, permissions, etc.)
-
Fixes the Containerfile
-
Retries the build (cached layers are reused)
Common fixes include:
* Fedora 41+ uses DNF 5, so dnf module commands are replaced with dnf install
* Wrong package names are corrected via dnf search
* Download URLs are fixed for the correct architecture
After 3 failed attempts, Claude Code stops and presents the error for manual review.