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
The build command automatically downloads cc-deck Linux binaries (amd64 + arm64) from GitHub Releases, matching your installed cc-deck version. No manual cross-compilation is needed.
If you are running a development build (version dev), pre-place the binaries manually:
# From the cc-deck source repo
make cross-cli
cp cc-deck/cc-deck-linux-* .cc-deck/image/build-context/
What Happens
-
Manifest validation: Checks that
cc-deck-image.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:
* 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.