opencode-container/Dockerfile
2026-01-13 13:48:49 +09:00

31 lines
658 B
Docker

FROM archlinux:latest
# Build args for user
ARG USERNAME=dev
ARG UID=1000
ARG GID=1000
# Install basic tools
RUN pacman -Syu --noconfirm \
git \
ca-certificates \
curl \
bash \
&& pacman -Scc --noconfirm
# Create user
RUN groupadd -g ${GID} ${USERNAME} && \
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME}
# Switch to non-root user
USER ${USERNAME}
WORKDIR /home/${USERNAME}
# Install OpenCode CLI via official installer
RUN curl -fsSL https://opencode.ai/install | bash
# Add OpenCode CLI to PATH
ENV PATH="/home/${USERNAME}/.opencode/bin:${PATH}"
# Default working directory
WORKDIR /home/${USERNAME}