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.
This commit is contained in:
Jeena 2026-01-15 12:13:05 +09:00
parent f479a613a0
commit b1f356c5f5
6 changed files with 27 additions and 21 deletions

View file

@ -1,31 +1,31 @@
FROM archlinux:latest
# Build args for user
ARG USERNAME=dev
ARG UID=1000
ARG GID=1000
# Install basic tools
RUN pacman -Syu --noconfirm \
base-devel \
git \
ca-certificates \
curl \
bash \
&& pacman -Scc --noconfirm
less \
ripgrep && \
groupadd -g ${GID} ${USERNAME} && \
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME} && \
pacman -Scc --noconfirm
# Create user
RUN groupadd -g ${GID} ${USERNAME} && \
useradd -m -u ${UID} -g ${GID} -s /bin/bash ${USERNAME}
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
# 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}