This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Docker debugging container designed for troubleshooting container infrastructure, particularly in Kubernetes environments. It's based on Alpine Linux and bundles numerous networking, debugging, and performance testing tools into a single image. The container supports both amd64 and arm64 architectures and is published to both Docker Hub (tdeutsch/debugcontainer) and GitHub Container Registry (ghcr.io/tuxpeople/debugcontainer).
docker build -t debugcontainer:local .docker buildx build --platform linux/amd64,linux/arm64 -t debugcontainer:local .This project uses Hadolint to ensure Dockerfile best practices. To run locally:
docker run --rm -i hadolint/hadolint < Dockerfiledocker run -it --rm debugcontainer:local /bin/bashThe project uses GitHub Actions with three key workflows:
- Pull Requests (
.github/workflows/pullrequests.yml): Runs Hadolint linting and builds forlinux/amd64andlinux/arm64platforms - Build & Release (
.github/workflows/release.yml): Triggered on releases, daily cron, or pushes to master/main. Builds, tags, and pushes to both Docker Hub and GHCR - Auto-assign Issues (
.github/workflows/auto-assign-issues.yaml): Automatically assigns issues
latest: Most recent tagged releasenightly: Daily automated builds via cron jobdevel: Latest version from master/main branch- Semantic versioning:
x.y.z,x.y, andxtags for releases
The project uses mathieudutour/github-tag-action to automatically create version tags and releases based on commit messages. All commits MUST follow the Conventional Commits format:
feat:- New features (triggers minor version bump, e.g., 1.0.0 → 1.1.0)fix:- Bug fixes (triggers patch version bump, e.g., 1.0.0 → 1.0.1)chore:- Maintenance tasks (no version bump)refactor:- Code refactoring (no version bump)docs:- Documentation changes (no version bump)BREAKING CHANGE:in commit body orfeat!:/fix!:- Breaking changes (triggers major version bump, e.g., 1.0.0 → 2.0.0)
Important: Since default_bump: false is set in the workflow, commits without conventional commit prefixes will NOT trigger a new release. Only properly formatted commits will create new versions.
Examples:
git commit -m "feat: add new debugging tool" # Creates minor version
git commit -m "fix: correct network configuration" # Creates patch version
git commit -m "chore: update dependencies" # No new version- Dockerfile: Single-stage Alpine-based image that installs all debugging tools
- requirements.txt: Python packages (currently only
azure-cli) - scripts/hdd-perf.sh: Storage performance testing script using dd, fio, ioping, and iozone
- renovate.json: Renovate bot configuration with automerge enabled for all updates
The container includes 60+ tools across several categories:
- Networking: tcpdump, nmap, mtr, iperf3, netcat, socat, arping, ethtool, tcptraceroute, ngrep
- DNS: bind-tools, dnsperf
- Container/Kubernetes: kubectl, crane (for container registry operations), flux, ytt, imgpkg (Carvel tools), oras (OCI registry client)
- Database: mariadb-client, mssql-tools
- Storage: minio-client, nfs-utils
- Performance: fio, hdparm, ioping, iozone, speedtest-cli
- General utilities: bash, curl, wget, jq, yq, vim, git, screen, tmux, htop, lsof, rsync
Key tools have pinned versions managed by Renovate:
- ORAS: Version pinned via
ARG ORAS_VERSIONin Dockerfile. Version stored in/etc/oras-version - Flux: Version pinned via
ARG FLUX_VERSIONin Dockerfile. Version stored in/etc/flux-version - Carvel ytt: Version pinned via
ARG CARVEL_YTT_VERSIONin Dockerfile. Version stored in/etc/ytt-version - Carvel imgpkg: Version pinned via
ARG CARVEL_IMGPKG_VERSIONin Dockerfile. Version stored in/etc/imgpkg-version
Renovate automatically creates PRs when new versions are released. All version files can be inspected at runtime in /etc/.
The Dockerfile uses a single-stage build with these key steps:
- Base image: Alpine 3.22.2
- Copies scripts and requirements.txt
- Installs all APK packages from edge repositories (main, community, testing)
- Installs flux CLI via shell script
- Installs select Carvel tools (ytt, imgpkg) while removing others (kapp, kbld, kwt, vendir)
- Installs ORAS from latest GitHub release with error handling and fallback
- Sets up bash completion for crane and oras
- Uses virtual build dependencies for Python packages, then removes them to reduce image size
- Creates a non-root user
abc(uid/gid 1000) - Stores dynamic tool versions in
/etc/for runtime inspection - Default command:
/bin/sleep inf(keeps container running indefinitely)
Edit the Dockerfile's apk add section (lines 21-84). Packages are installed from edge repositories to get latest versions.
Add to requirements.txt. Note the use of --break-system-packages flag since Alpine uses system-managed Python.
Place new scripts in the scripts/ directory. They will be copied to /scripts/ in the container and made executable.
When adding tools that are installed from GitHub releases or external sources:
- Add installation logic in the main RUN command (after Carvel tools, before Python packages)
- Use error handling with fallback versions (see ORAS installation as example)
- Store the installed version in
/etc/<tool>-versionfor traceability - Add bash completion if supported:
<tool> completion bash > /etc/bash_completion.d/<tool> - Update this CLAUDE.md file to document the new tool
Renovate is configured to automatically update dependencies with automerge enabled for all updates, including patch versions. The configuration ensures fast dependency updates without manual intervention.
The following tools are version-pinned in the Dockerfile and automatically updated by Renovate:
- Flux CLI (
fluxcd/flux2) - ORAS (
oras-project/oras) - Carvel ytt (
carvel-dev/ytt) - Carvel imgpkg (
carvel-dev/imgpkg)
Renovate uses regex managers to detect version updates in the Dockerfile ARG statements and creates PRs with changelogs when new versions are released. This provides:
- Clear visibility of tool version changes in git history
- Automatic changelog generation from GitHub releases
- Ability to review and test updates before merging
- Reproducible builds with locked versions
- Platform Support: The container builds for
linux/amd64andlinux/arm64only. Both PR and release workflows must use identical platform lists. - Bash Completion: Tools with bash completion support should have their completions installed in
/etc/bash_completion.d/ - Error Handling: Dynamic installations from external sources should include error handling and fallback versions to prevent build failures