agent-container/Dockerfile
Jeena 5c2f3ae83c container: Add Pi coding agent (pi.dev) as a third harness
- Install @earendil-works/pi-coding-agent globally via npm in the
  image so it survives the home directory bind mount
- Add pi subcommand forwarding PI_* and provider key prefixes
- Add pi shell wrapper alias
- Build with --network host so image builds work on hosts where the
  Docker bridge network cannot create veth pairs
2026-08-30 11:50:56 +09:00

46 lines
1.4 KiB
Docker

FROM archlinux:latest
ARG USERNAME=dev
ARG UID=1000
ARG GID=1000
RUN pacman -Syu --noconfirm \
base-devel \
git \
ca-certificates \
bash \
less \
ripgrep \
nodejs \
npm \
curl \
sudo && \
groupadd -g ${GID} ${USERNAME} && \
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME} && \
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
pacman -Scc --noconfirm
# Install OpenCode from AUR
WORKDIR /tmp
USER ${USERNAME}
RUN git clone https://aur.archlinux.org/opencode-bin.git && \
cd opencode-bin && \
makepkg --syncdeps --noconfirm --install && \
sudo rm -rf /tmp/opencode-bin && \
sudo pacman -Scc --noconfirm
# Install Claude Code using the native installer, then copy the binary
# to a system-wide location so it survives the home directory bind mount
RUN curl -fsSL https://claude.ai/install.sh | bash && \
sudo cp ~/.local/bin/claude /usr/local/bin/claude && \
rm -rf ~/.local/share/claude ~/.local/bin/claude ~/.claude ~/.claude.json \
~/.cache/claude
# Install Pi Coding Agent globally with npm so it lands in the system
# prefix and survives the home directory bind mount (same approach as
# pi's own docs/containerization.md)
RUN sudo npm install -g --ignore-scripts @earendil-works/pi-coding-agent && \
sudo npm cache clean --force
WORKDIR /home/${USERNAME}