Fix permissions for real this time

This commit is contained in:
Ryan Hughes committed 2025-10-23 00:16:11 -04:00
1 parent 26ac717c3a
commit db283dd98a
2 files changed
+16 -22

No files matched your search

+5 -14
View File
@@ -4,23 +4,14 @@ FROM archlinux:latest
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm base-devel git sudo wget jq gnupg
# Create build user (required for makepkg)
# Note: UID/GID can be overridden at runtime via --build-arg
ARG BUILD_UID=1000
ARG BUILD_GID=1000
# Create build user (required for makepkg - cannot run as root)
RUN useradd -m -G wheel builder && \
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Only create builder user if not using root (UID 0)
RUN if [ ${BUILD_UID} -ne 0 ]; then \
groupadd -g ${BUILD_GID} builder && \
useradd -m -u ${BUILD_UID} -g ${BUILD_GID} -G wheel builder && \
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers; \
fi
# Switch to builder user if not root, otherwise stay as root
USER ${BUILD_UID}
USER builder
WORKDIR /src
# Setup GPG directory for whichever user we're using
# Setup GPG directory
RUN mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
# Default command