Skip to content

Instantly share code, notes, and snippets.

@christian-korneck
Created January 9, 2021 12:03
Show Gist options
  • Save christian-korneck/14d6105b1964e809f59858ec5f7c0a40 to your computer and use it in GitHub Desktop.
Save christian-korneck/14d6105b1964e809f59858ec5f7c0a40 to your computer and use it in GitHub Desktop.
build/install archlinux AUR package in a container

quick hack to try the docker-pushrm package from the archlinux AUR repo in a Docker container

usage:

docker build -t dprm .
docker run --rm -ti dprm
$ docker --help | grep -i pushrm
pushrm*     Push Readme to container registry (Christian Korneck, 1.7.0)
FROM archlinux
RUN pacman -Sy --noconfirm git go base-devel docker
# makepkg needs to run under an unprived user and sudo out
RUN useradd -m -G wheel -s /bin/sh worker
RUN echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/tempbuild
USER worker
RUN cd $HOME && git clone https://aur.archlinux.org/docker-pushrm.git
RUN cd $HOME/docker-pushrm && makepkg -si --noconfirm
USER root
RUN rm /etc/sudoers.d/tempbuild
RUN userdel -f worker && rm -Rf /home/worker
CMD /bin/sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment