fix some test findings

This commit is contained in:
2026-09-05 21:40:41 +02:00
parent 84db84b542
commit 055d8a9620
5 changed files with 25 additions and 12 deletions
+9 -5
View File
@@ -39,8 +39,12 @@ RUN useradd -m -u "$UID_ARG" -s /bin/bash -G wheel "$USERNAME"
RUN printf '%%wheel ALL=(ALL) NOPASSWD: ALL\n' > /etc/sudoers.d/wheel-nopasswd \
&& chmod 440 /etc/sudoers.d/wheel-nopasswd
USER "$USERNAME"
ENV HOME="/home/$USERNAME"
# Use a literal (not the ARG) for USER/ENV: the legacy builder can silently
# ignore a `USER "$ARG"` when the variable resolves after a stage boundary,
# leaving the container running as root (which breaks git ownership checks on
# the mounted host-owned repo). The value is fixed at mathias by default anyway.
USER mathias
ENV HOME="/home/mathias"
WORKDIR /dotfiles
# ---------------------------------------------------------------------------
@@ -51,10 +55,10 @@ FROM base AS dev
USER root
RUN pacman -S --noconfirm --needed shellcheck
USER "$USERNAME"
USER mathias
WORKDIR /dotfiles
COPY --chown="$USERNAME" . /dotfiles
COPY --chown=mathias . /dotfiles
CMD ["bash", "test/lint.sh"]
@@ -65,7 +69,7 @@ CMD ["bash", "test/lint.sh"]
# ---------------------------------------------------------------------------
FROM base AS test
USER "$USERNAME"
USER mathias
WORKDIR /dotfiles
# The entrypoint drives the smoke tests. The repo is mounted at /dotfiles