Skip to content

Commit a3ec684

Browse files
authored
Add a builder user and install sudo (#40)
* Add a builder user and run everything as it This should allow to also build PKGBUILDs with makepkg which isn't allowed to run as root. * Only create the user, don't run as it by default GitHub Actions run the checkout modules as a separate user which breaks if the Docker container defines its own user.
1 parent 45924ec commit a3ec684

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM archlinux:latest
2-
RUN pacman --noconfirm -Sy rustup gcc pkg-config \
2+
RUN pacman --noconfirm -Sy rustup gcc pkg-config sudo \
33
&& rm /var/lib/pacman/sync/* \
44
&& rm /var/cache/pacman/pkg/*
55

6+
# Add a builder user since makepkg cannot (and should not) be run as root
7+
RUN useradd -m builder \
8+
&& echo "builder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
9+
610
ARG RUST_VERSION=stable
711
RUN rustup install --profile minimal $RUST_VERSION
812

0 commit comments

Comments
 (0)