Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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 tools
- `docker/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
Expand All @@ -20,6 +21,9 @@ 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

Expand All @@ -37,6 +41,9 @@ PUSH=true REGISTRY=ghcr.io/chaitin/monkeycode-runner STACK=base VERSION=bookworm
# 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

Expand Down Expand Up @@ -88,7 +95,7 @@ docker run --rm -it ghcr.io/chaitin/monkeycode-runner/golang:1.25-bookworm go ve

### CI Testing
- All images must build successfully in GitHub Actions
- Matrix builds test all three stacks concurrently
- Matrix builds test all stacks concurrently
- Multi-architecture support is verified automatically

## Commit & Pull Request Guidelines
Expand Down Expand Up @@ -136,5 +143,6 @@ Default registry: `ghcr.io/chaitin/monkeycode-runner`
Image naming: `{registry}/{stack}:{version}`
Examples:
- `ghcr.io/chaitin/monkeycode-runner/base:bookworm`
- `ghcr.io/chaitin/monkeycode-runner/devbox:bookworm`
- `ghcr.io/chaitin/monkeycode-runner/frontend:node20`
- `ghcr.io/chaitin/monkeycode-runner/golang:1.25-bookworm`
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,34 @@ Base container images for Chaitin MonkeyCode developer workflows.
STACK=base VERSION=bookworm ./scripts/build.sh
- Run: `docker run --rm -it ghcr.io/chaitin/monkeycode-runner/base:bookworm bash`

## Devbox image (bookworm)
- Dockerfile: `docker/devbox/bookworm/Dockerfile` (extends base image and adds diagnostic packages: htop, iputils-ping, iproute2 (ip/ss), wget).
## Devbox image (bookworm) - All-in-one Development Environment
- Dockerfile: `docker/devbox/bookworm/Dockerfile` (extends base image with Go 1.25.6, Node.js 22.22.0 LTS, Python 3.11, and diagnostic tools).
- Build locally: `STACK=devbox VERSION=bookworm ./scripts/build.sh`
- Push to GHCR: `PUSH=true REGISTRY=ghcr.io/chaitin/monkeycode-runner STACK=devbox VERSION=bookworm ./scripts/build.sh`
- Run: `docker run --rm -it ghcr.io/chaitin/monkeycode-runner/devbox:bookworm htop`
- Run: `docker run --rm -it ghcr.io/chaitin/monkeycode-runner/devbox:bookworm bash`

### Included Tools:
- **Go 1.25.6**: with staticcheck, gofumpt, swag
- **Node.js 22.22.0**: with Corepack (pnpm, yarn enabled)
- **Python 3.11**: with pip (PIP_BREAK_SYSTEM_PACKAGES enabled)
- Pre-installed packages: requests, flask, django, beautifulsoup4, scrapy
- **Diagnostic tools**: htop, iputils-ping, iproute2, wget

### Example Usage:
```bash
# Run the container
docker run --rm -it -v $(pwd):/workspace ghcr.io/chaitin/monkeycode-runner/devbox:bookworm bash

# Inside the container:
go version # Go 1.25.6
node --version # v22.22.0
python3 --version # 3.11.x
npm install # Works with Corepack enabled
python3 -c "import requests; print('requests:', requests.__version__)" # 2.32.5
python3 -c "import flask; print('flask:', flask.__version__)" # 3.1.2
python3 -c "import django; print('django:', django.VERSION)" # (5, 2, 10, 'final', 0)
python3 -c "import scrapy; print('scrapy:', scrapy.__version__)" # 2.14.1
```

## Frontend image (node20)
- Dockerfile: `docker/frontend/node20/Dockerfile` (extends base image with Node.js 20 and Corepack for frontend tooling).
Expand All @@ -41,7 +64,7 @@ Base container images for Chaitin MonkeyCode developer workflows.

## Layout
- `docker/base/bookworm/Dockerfile` – base image definition.
- `docker/devbox/bookworm/Dockerfile` – devbox image with common diagnostic tools.
- `docker/devbox/bookworm/Dockerfile` – all-in-one devbox with Go, Node.js, and Python.
- `docker/frontend/node20/Dockerfile` – Node.js frontend developer image.
- `docker/golang/1.25-bookworm/Dockerfile` – Go developer image (bookworm + Go 1.25).
- `docker/rust/1.91-bookworm/Dockerfile` – Rust developer image (bookworm + Rust 1.91).
Expand Down
53 changes: 51 additions & 2 deletions docker/devbox/bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,68 @@
# Devbox image derived from the DevRunner base stack
# Devbox all-in-one development environment derived from the DevRunner base stack
ARG BASE_IMAGE=ghcr.io/chaitin/monkeycode-runner/base:bookworm
FROM ${BASE_IMAGE}

LABEL org.opencontainers.image.title="DevRunner Devbox" \
org.opencontainers.image.source="https://github.com/chaitin/DevRunner" \
org.opencontainers.image.description="Devbox toolbox image for DevRunner stacks with common diagnostics"
org.opencontainers.image.description="All-in-one development environment with Go, Node.js, and Python"

ARG DEBIAN_FRONTEND=noninteractive
ARG GO_VERSION=1.25.6
ARG NODE_VERSION=22.22.0

ENV GOROOT=/usr/local/go \
GOPATH=/go \
GOCACHE=/go/cache \
PATH=/usr/local/go/bin:/go/bin:${PATH}

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
xz-utils \
htop \
iputils-ping \
iproute2 \
wget \
&& rm -rf /var/lib/apt/lists/*

RUN set -eux; \
mkdir -p "${GOPATH}" "${GOCACHE}"; \
GO_ARCH="$(dpkg --print-architecture)"; \
case "${GO_ARCH}" in \
amd64) GO_ARCHIVE="linux-amd64"; GO_SHA256="f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a" ;; \
arm64) GO_ARCHIVE="linux-arm64"; GO_SHA256="738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5" ;; \
*) echo "Unsupported architecture: ${GO_ARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://go.dev/dl/go${GO_VERSION}.${GO_ARCHIVE}.tar.gz" -o /tmp/go.tar.gz; \
echo "${GO_SHA256} /tmp/go.tar.gz" | sha256sum -c -; \
tar -C /usr/local -xzf /tmp/go.tar.gz; \
rm /tmp/go.tar.gz; \
go install honnef.co/go/tools/cmd/staticcheck@latest; \
go install mvdan.cc/gofumpt@latest; \
go install github.com/swaggo/swag/cmd/swag@latest

RUN set -eux; \
NODE_ARCH="$(dpkg --print-architecture)"; \
case "${NODE_ARCH}" in \
amd64) node_arch="x64"; NODE_SHA256="9aa8e9d2298ab68c600bd6fb86a6c13bce11a4eca1ba9b39d79fa021755d7c37" ;; \
arm64) node_arch="arm64"; NODE_SHA256="1bf1eb9ee63ffc4e5d324c0b9b62cf4a289f44332dfef9607cea1a0d9596ba6f" ;; \
*) echo "Unsupported architecture: ${NODE_ARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${node_arch}.tar.xz"; \
curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt"; \
grep " node-v${NODE_VERSION}-linux-${node_arch}.tar.xz$" SHASUMS256.txt | sha256sum -c -; \
tar -xJf "node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" -C /usr/local --strip-components=1; \
rm -f "node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" SHASUMS256.txt; \
corepack enable

ENV PIP_BREAK_SYSTEM_PACKAGES=1

RUN pip3 install --no-cache-dir \
requests \
flask \
django \
beautifulsoup4 \
scrapy

ENV NODE_VERSION=${NODE_VERSION}

WORKDIR /workspace