|
| 1 | +FROM codercom/example-node:ubuntu |
| 2 | + |
| 3 | +USER root |
| 4 | + |
| 5 | +# Apt: mc, nano, PHP 8.5 (Ondrej), GitHub CLI |
| 6 | +RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && \ |
| 7 | + apt-get install -y --no-install-recommends mc nano software-properties-common ca-certificates && \ |
| 8 | + add-apt-repository -y ppa:ondrej/php && \ |
| 9 | + apt-get update -y && \ |
| 10 | + apt-get install -y --no-install-recommends \ |
| 11 | + php8.5-cli php8.5-common php8.5-curl php8.5-intl php8.5-mbstring php8.5-readline php8.5-xml php8.5-zip && \ |
| 12 | + mkdir -p -m 755 /etc/apt/keyrings && \ |
| 13 | + (out=$(mktemp) && wget -nv -O"$out" https://cli.github.com/packages/githubcli-archive-keyring.gpg && \ |
| 14 | + cat "$out" > /etc/apt/keyrings/githubcli-archive-keyring.gpg && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg) && \ |
| 15 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list && \ |
| 16 | + apt-get update -y && \ |
| 17 | + apt-get install -y --no-install-recommends gh && \ |
| 18 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
| 19 | + |
| 20 | +# Composer (system-wide) |
| 21 | +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
| 22 | + |
| 23 | +# Deno (system-wide) |
| 24 | +ENV DENO_INSTALL=/usr/local |
| 25 | +RUN curl -fsSL https://deno.land/install.sh | sh |
| 26 | + |
| 27 | +# Bun (system-wide) |
| 28 | +ENV BUN_INSTALL=/usr/local |
| 29 | +RUN curl -fsSL https://bun.sh/install | bash |
| 30 | + |
| 31 | +# Claude CLI (install script may use $HOME; we copy binary to /usr/local/bin) |
| 32 | +RUN curl -fsSL https://claude.ai/install.sh | bash || true && \ |
| 33 | + if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi && \ |
| 34 | + if [ -f /root/bin/claude ]; then cp /root/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi |
| 35 | + |
| 36 | +# OpenCode (same: install then ensure binary in PATH) |
| 37 | +RUN curl -fsSL https://opencode.ai/install | bash || true && \ |
| 38 | + if [ -f /root/.local/bin/opencode ]; then cp /root/.local/bin/opencode /usr/local/bin/opencode && chmod +x /usr/local/bin/opencode; fi && \ |
| 39 | + if [ -f /root/bin/opencode ]; then cp /root/bin/opencode /usr/local/bin/opencode && chmod +x /usr/local/bin/opencode; fi |
| 40 | + |
| 41 | +# Cursor Agent CLI (https://cursor.com/docs/cli) |
| 42 | +RUN curl -fsSL https://cursor.com/install | bash || true && \ |
| 43 | + if [ -f /root/.local/bin/cursor-agent ]; then cp /root/.local/bin/cursor-agent /usr/local/bin/cursor-agent && chmod +x /usr/local/bin/cursor-agent; fi && \ |
| 44 | + if [ -f /root/bin/cursor-agent ]; then cp /root/bin/cursor-agent /usr/local/bin/cursor-agent && chmod +x /usr/local/bin/cursor-agent; fi |
| 45 | + |
| 46 | +# npm global tools |
| 47 | +RUN npm install -g @openai/codex @github/copilot |
| 48 | + |
| 49 | +# PATH and env for all users (Deno, Bun) — append to bash profile |
| 50 | +RUN echo '' >> /etc/profile && \ |
| 51 | + echo '# coder-env: Deno, Bun' >> /etc/profile && \ |
| 52 | + echo 'export DENO_INSTALL="${DENO_INSTALL:-/usr/local}"' >> /etc/profile && \ |
| 53 | + echo 'export BUN_INSTALL="${BUN_INSTALL:-/usr/local}"' >> /etc/profile && \ |
| 54 | + echo '[ -d "$DENO_INSTALL/bin" ] && export PATH="$DENO_INSTALL/bin:$PATH"' >> /etc/profile && \ |
| 55 | + echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile |
| 56 | + |
| 57 | +WORKDIR /home/coder |
| 58 | +USER coder |
0 commit comments