Created
August 16, 2019 09:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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