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
4 changes: 4 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
context: images/backend-builder-base
file: images/backend-builder-base/Dockerfile
version_file: images/backend-builder-base/VERSION
- image_name: coding-agent-base
context: images/coding-agent-base
file: images/coding-agent-base/Dockerfile
version_file: images/coding-agent-base/VERSION

permissions:
contents: read
Expand Down
46 changes: 46 additions & 0 deletions images/coding-agent-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# coding-agent-base
# Base image for AI coding agents (Claude Code, OpenCode, Codex, etc.)
#
# Purpose: Provide a consistent, isolated environment for coding agents
# that can be used to work on repositories safely.
#
# Security features:
# - No host filesystem access (use volume mounts)
# - Minimal attack surface (Alpine-based)
# - No privileged operations
# - Network access configurable at runtime

ARG NODE_VERSION=20.20.0
ARG ALPINE_VERSION=3.22
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION}

# Install core tools
RUN apk add --no-cache \
bash \
build-base \
ca-certificates \
curl \
git \
jq \
openssh-client \
pkgconf \
tar \
unzip \
xz \
zstd \
&& rm -rf /var/cache/apk/*

# Install GitHub CLI
RUN apk add --no-cache github-cli

# Create non-root user for safety
RUN addgroup -S agent && adduser -S agent -G agent

# Set up workspace
WORKDIR /workspace

# Agent runs as non-root by default
USER agent

# Default to bash for interactive use
CMD ["/bin/bash"]
76 changes: 76 additions & 0 deletions images/coding-agent-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding-agent-base

Base image for AI coding agents (Claude Code, OpenCode, Codex, etc.)

## Purpose

Provide a consistent, isolated environment for coding agents that can work on repositories safely.

## Includes

- Alpine Linux 3.22
- Node.js 20.20.0
- Git
- GitHub CLI (`gh`)
- Build toolchain (`build-base`)
- SSH client (for git over SSH)
- Common utilities (`curl`, `jq`, `tar`, etc.)

## Security Features

- Non-root user (`agent`) by default
- No host filesystem access (use volume mounts)
- Minimal attack surface (Alpine-based)
- No privileged operations

## Usage

### Basic run with volume mount

```bash
docker run -it --rm \
-v /path/to/repo:/workspace \
-e ANTHROPIC_API_KEY=your-key \
ghcr.io/makerprism/coding-agent-base:1.0.0 \
/bin/bash
```

### With OpenCode

```bash
docker run -it --rm \
-v /path/to/repo:/workspace \
-e ANTHROPIC_API_KEY=your-key \
ghcr.io/makerprism/coding-agent-base:1.0.0 \
npx opencode-ai
```

### With Claude Code

```bash
docker run -it --rm \
-v /path/to/repo:/workspace \
-e ANTHROPIC_API_KEY=your-key \
ghcr.io/makerprism/coding-agent-base:1.0.0 \
npx @zed-industries/claude-agent-acp
```

## Customizing

For project-specific needs, extend this image:

```dockerfile
FROM ghcr.io/makerprism/coding-agent-base:1.0.0

# Add OCaml toolchain
USER root
RUN apk add --no-cache ocaml opam
USER agent

# Install additional npm tools
RUN npm install -g some-tool
```

## Versioning

See [VERSION](./VERSION) file. Follows semantic versioning.
1 change: 1 addition & 0 deletions images/coding-agent-base/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0