This repository contains Docker container images for Chaitin MonkeyCode developer workflows. The structure is organized as follows:
docker/base/bookworm/- Base Debian bookworm-slim image with essential development toolsdocker/devbox/bookworm/- All-in-one devbox with Go, Node.js, Python, and common packages (extends base)docker/frontend/node20/- Node.js 20 frontend development image (extends base)docker/golang/1.25-bookworm/- Go 1.25 development image (extends base)scripts/build.sh- Environment-driven build script for all images.github/workflows/ci.yaml- CI/CD pipeline for automated builds and pushesREADME.md- Project documentation and usage instructions
Each stack directory contains a single Dockerfile defining that specific image.
# Base image
STACK=base VERSION=bookworm ./scripts/build.sh
# Devbox all-in-one image
STACK=devbox VERSION=bookworm ./scripts/build.sh
# Frontend Node.js image
STACK=frontend VERSION=node20 ./scripts/build.sh
# Go development image
STACK=golang VERSION=1.25-bookworm ./scripts/build.shPUSH=true REGISTRY=ghcr.io/chaitin/monkeycode-runner STACK=base VERSION=bookworm ./scripts/build.sh# Base image
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/base:bookworm bash
# Devbox all-in-one image
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/devbox:bookworm bash
# Frontend image
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/frontend:node20 node --version
# Go image
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/golang:1.25-bookworm bashThe GitHub Actions workflow automatically:
- Builds all images on pull requests (no push)
- Builds and pushes images on main branch merges
- Supports multi-architecture builds (amd64/arm64)
- Tags images with version, branch, and
latestas appropriate
- Use
debian:bookworm-slimas base for the foundational image - All derived images extend the base image
- Include proper OCI labels (
org.opencontainers.image.*) - Use
ARG DEBIAN_FRONTEND=noninteractivefor non-interactive builds - Set
WORKDIR /workspacefor consistency - Architectural support for amd64 and arm64
- Stack directories use lowercase:
base/,frontend/,golang/ - Version naming follows tool conventions:
bookworm,node20,1.25-bookworm - Dockerfile paths:
docker/{stack}/{version}/Dockerfile
- Use
#!/usr/bin/env bashshebang - Enable strict mode:
set -euo pipefail - Environment variables with sensible defaults
- Clear error messages to stderr
Test images locally before pushing:
# Build and test basic functionality
STACK=base VERSION=bookworm ./scripts/build.sh
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/base:bookworm bash -c "git --version && python3 --version"
# Test specific tools
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/frontend:node20 node --version
docker run --rm -it ghcr.io/chaitin/monkeycode-runner/golang:1.25-bookworm go version- All images must build successfully in GitHub Actions
- Matrix builds test all stacks concurrently
- Multi-architecture support is verified automatically
Follow conventional commit format observed in the project:
Merge pull request #3 from xiaomakuaiz/feature/frontend-node
Add Node frontend stack and update CI
Feature branches should use descriptive names:
feature/frontend-nodefeature/golang-updatefix/base-image-security
- Title should clearly describe the change
- Description should explain the purpose and impact
- Include testing instructions for new features
- Ensure all images build successfully in CI
- Update README.md if adding new stacks or changing usage
- Target the
mainbranch for all changes
- Verify checksums for all downloaded binaries
- Use minimal base images (
bookworm-slim) - Clean up package manager caches (
rm -rf /var/lib/apt/lists/*) - Run as non-root user when appropriate (current images use root for development flexibility)
- Create feature branch from
main - Add new Dockerfile in appropriate
docker/{stack}/{version}/directory - Update
scripts/build.shif needed (usually not required) - Update CI matrix in
.github/workflows/ci.yamlfor new stacks - Update
README.mdwith usage instructions - Test locally with provided commands
- Submit pull request following guidelines above
Default registry: ghcr.io/chaitin/monkeycode-runner
Image naming: {registry}/{stack}:{version}
Examples:
ghcr.io/chaitin/monkeycode-runner/base:bookwormghcr.io/chaitin/monkeycode-runner/devbox:bookwormghcr.io/chaitin/monkeycode-runner/frontend:node20ghcr.io/chaitin/monkeycode-runner/golang:1.25-bookworm