Skip to content

Instantly share code, notes, and snippets.

@peakBreaker
Created August 16, 2019 09:55
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 peakBreaker/32ecb0f0a40faf1c77a671c3afc1036e to your computer and use it in GitHub Desktop.
Save peakBreaker/32ecb0f0a40faf1c77a671c3afc1036e to your computer and use it in GitHub Desktop.
Build an arch based dockerimage with yay for installing packages. Useful for testing bugs if they show up in arch
FROM archlinux/base:latest
# Basic dependencies
RUN pacman -Syu --noconfirm
RUN pacman -S tar curl sudo grep base-devel --noconfirm
RUN mkdir -p /opt/yay/
WORKDIR /opt/yay/
# Add the builduser (cant install yay as root)
RUN useradd builduser -m # Create the builduser
RUN usermod -aG root builduser
RUN passwd -d builduser # Delete the buildusers password
RUN printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers # Allow the builduser passwordless sudo
# Download yay
RUN curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz && tar -xvf yay.tar.gz
RUN chown -R builduser ./
# Install yay for the user
USER builduser
RUN cd yay && makepkg --noconfirm -si
# RUN yay -Syu --noconfirm <package>
ENTRYPOINT /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment