Local Development Setup¶
Build, test, and contribute to DebugBox locally.
Prerequisites¶
- Docker (or Podman with
alias docker=podman) - Make (GNU make)
- Git
- Python 3.8+ (for MkDocs documentation preview)
Clone & Setup¶
Build Commands¶
Build All Variants¶
Builds all three variants for the host architecture:
Output:
Build Single Variant¶
Build for Specific Architecture¶
Skip Cache (Fresh Build)¶
Quality Checks¶
Lint Dockerfiles¶
Runs hadolint to check Dockerfile syntax and best practices:
Uses local hadolint if available, otherwise runs containerized version.
Security Scanning¶
Scans images with Trivy for vulnerabilities (HIGH/CRITICAL only):
Requires build-all first (auto-triggered).
Test Commands¶
Run All Tests¶
Executes smoke tests on all three variants:
Auto-builds and lints first.
Test Single Variant¶
What's tested: Each variant runs tests/smoke.sh to verify:
- Essential tools are present
- Shells work correctly
- Network tools function
- Helpers are available (balanced+)
Manual Testing¶
docker run -it debugbox:lite-local sh
docker run -it debugbox:balanced-local bash
tcpdump --version
docker run -it debugbox:power-local bash
tshark -v
Documentation Preview¶
Install Dependencies¶
Start Local Server¶
Opens at http://localhost:8000 with live reload.
Build Static Docs¶
Development Workflow¶
Make a Change¶
-
Edit Dockerfile:
-
Edit docs:
-
Build locally:
-
Test the changes:
-
Preview docs:
Quality Gates¶
Before committing, run the full pipeline:
make lint # Dockerfile syntax
make build-all # All variants build
make test-all # All tests pass
make scan # No vulnerabilities
Or shortcut:
Make Targets Reference¶
| Command | Purpose |
|---|---|
make help |
Show all available commands |
make build-all |
Build all variants (host architecture) |
make run-<variant> |
Run variant interactively |
make build-<variant> |
Build single variant (lite/balanced/power) |
make test-all |
Test all variants |
make test-<variant> |
Test single variant |
make lint |
Lint all Dockerfiles |
make scan |
Security scan with Trivy |
make check |
Full pipeline (lint → build → test → scan) |
make clean |
Remove local images |
Environment Variables¶
| Variable | Default | Description |
|---|---|---|
LOCAL_TAG |
local |
Local build tag suffix |
PLATFORM |
host architecture (e.g. linux/amd64) |
Target architecture |
NO_CACHE |
false |
Disable Docker build cache |
Example:
Troubleshooting¶
Make not found¶
Build fails with permission error¶
Build fails with exec /bin/sh: exec format error¶
This error occurs when building for a foreign architecture without binfmt/QEMU support. The Makefile defaults to the host architecture automatically (PLATFORM ?= linux/$(HOST_ARCH)), so this error only appears when PLATFORM is explicitly set to a different architecture than the host.
Option 1: Enable multi-architecture builds (recommended)
Install binfmt/QEMU emulation to build for any architecture on any host:
Option 2: Build for the host architecture only
Omit the PLATFORM override and let the Makefile detect the host:
To verify which platform will be used:
Trivy scan errors¶
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin v0.69.1
# Or skip scan
make build-all test-all