opencode-container/Dockerfile
Jeena b1f356c5f5 Fix problem where container home was seperate for each project dir
The problem was that we mounted `pwd` as HOME and that meant that
every time git was used it would look into the data and work for a
long time, and it would also commit everything there.

Now we have a central container-home directory in the directory
where we checked out this git repo and it is used by each session
independent of in which project directory we are.
2026-01-15 12:19:07 +09:00

31 lines
665 B
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 && \
groupadd -g ${GID} ${USERNAME} && \
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME} && \
pacman -Scc --noconfirm
WORKDIR /tmp
USER ${USERNAME}
RUN git clone https://aur.archlinux.org/opencode-bin.git && \
cd opencode-bin && \
makepkg --noconfirm
USER root
RUN pacman -U --noconfirm /tmp/opencode-bin/*.pkg.tar.zst && \
rm -rf /tmp/opencode-bin && \
pacman -Scc --noconfirm
USER ${USERNAME}
WORKDIR /home/${USERNAME}