Skip to content

Instantly share code, notes, and snippets.

@glostis
Created March 14, 2024 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glostis/c8bcde5ff3bf91b1ffa1fb4bbe930463 to your computer and use it in GitHub Desktop.
Save glostis/c8bcde5ff3bf91b1ffa1fb4bbe930463 to your computer and use it in GitHub Desktop.
Dockerfile based on Archlinux with `yay` installed
FROM archlinux
# Need to create a non-root user, otherwise `makepkg` refuses to work
RUN useradd --no-create-home --shell=/bin/false build && usermod -L build
RUN echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN pacman -Syu --noconfirm && pacman -S --noconfirm sudo
USER build
WORKDIR /home/build
RUN sudo pacman -S --needed --noconfirm git base-devel && \
git clone https://aur.archlinux.org/yay-bin.git && \
cd yay-bin && \
makepkg -si --noconfirm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment