2026-02-27 04:29:51 +00:00
|
|
|
FROM ubuntu:24.04
|
|
|
|
|
|
|
|
|
|
# Avoid interactive prompts during package install
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
|
|
# ── System packages ──────────────────────────────────────────────────────────
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
git \
|
|
|
|
|
curl \
|
|
|
|
|
wget \
|
|
|
|
|
openssh-client \
|
|
|
|
|
build-essential \
|
|
|
|
|
ripgrep \
|
|
|
|
|
jq \
|
|
|
|
|
sudo \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
gnupg \
|
|
|
|
|
locales \
|
|
|
|
|
unzip \
|
|
|
|
|
pkg-config \
|
|
|
|
|
libssl-dev \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Set UTF-8 locale
|
|
|
|
|
RUN locale-gen en_US.UTF-8
|
|
|
|
|
ENV LANG=en_US.UTF-8
|
|
|
|
|
ENV LC_ALL=en_US.UTF-8
|
|
|
|
|
|
|
|
|
|
# ── GitHub CLI ───────────────────────────────────────────────────────────────
|
|
|
|
|
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
|
|
|
|
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
|
|
|
|
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
|
|
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
|
|
|
|
|
> /etc/apt/sources.list.d/github-cli.list \
|
|
|
|
|
&& apt-get update && apt-get install -y gh \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# ── Node.js LTS (22.x) + pnpm ───────────────────────────────────────────────
|
|
|
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
|
|
|
|
&& apt-get install -y nodejs \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
|
&& npm install -g pnpm
|
|
|
|
|
|
|
|
|
|
# ── Python 3 + pip + uv + ruff ──────────────────────────────────────────────
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
python3 \
|
|
|
|
|
python3-pip \
|
|
|
|
|
python3-venv \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
|
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
|
|
|
|
&& curl -LsSf https://astral.sh/ruff/install.sh | sh
|
|
|
|
|
|
|
|
|
|
# ── Docker CLI (not daemon) ─────────────────────────────────────────────────
|
|
|
|
|
RUN install -m 0755 -d /etc/apt/keyrings \
|
|
|
|
|
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
|
|
|
|
|
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
|
|
|
|
|
&& chmod a+r /etc/apt/keyrings/docker.gpg \
|
|
|
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
|
|
|
|
|
> /etc/apt/sources.list.d/docker.list \
|
|
|
|
|
&& apt-get update && apt-get install -y docker-ce-cli \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-02-27 14:29:40 +00:00
|
|
|
# ── AWS CLI v2 ───────────────────────────────────────────────────────────────
|
|
|
|
|
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
|
|
|
|
|
&& unzip awscliv2.zip && ./aws/install && rm -rf awscliv2.zip aws
|
|
|
|
|
|
2026-02-27 04:29:51 +00:00
|
|
|
# ── Non-root user with passwordless sudo ─────────────────────────────────────
|
|
|
|
|
RUN useradd -m -s /bin/bash claude \
|
|
|
|
|
&& echo "claude ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/claude \
|
|
|
|
|
&& chmod 0440 /etc/sudoers.d/claude
|
|
|
|
|
|
|
|
|
|
# ── Mount points (created as root, owned by claude) ──────────────────────────
|
|
|
|
|
RUN mkdir -p /workspace && chown claude:claude /workspace
|
|
|
|
|
|
|
|
|
|
# ── Rust (installed as claude user) ──────────────────────────────────────────
|
|
|
|
|
USER claude
|
|
|
|
|
WORKDIR /home/claude
|
|
|
|
|
|
|
|
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
|
ENV PATH="/home/claude/.cargo/bin:${PATH}"
|
|
|
|
|
|
|
|
|
|
# Add uv/ruff to PATH (installed to /root by default, reinstall for claude user)
|
|
|
|
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
|
|
|
|
|
&& curl -LsSf https://astral.sh/ruff/install.sh | sh
|
|
|
|
|
ENV PATH="/home/claude/.local/bin:/home/claude/.cargo/bin:${PATH}"
|
|
|
|
|
|
|
|
|
|
# ── Claude Code ──────────────────────────────────────────────────────────────
|
|
|
|
|
RUN curl -fsSL https://claude.ai/install.sh | bash
|
|
|
|
|
ENV PATH="/home/claude/.claude/bin:${PATH}"
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p /home/claude/.claude /home/claude/.ssh
|
|
|
|
|
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
|
|
2026-02-27 04:36:01 +00:00
|
|
|
# ── Switch back to root for entrypoint (handles UID/GID remapping) ─────────
|
|
|
|
|
USER root
|
|
|
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
2026-02-27 04:29:51 +00:00
|
|
|
|
2026-02-27 04:36:01 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|