2021-05-13 17:44:02 +02:00
|
|
|
# Inspiration:
|
|
|
|
# * https://github.com/ungoogled-software/ungoogled-chromium-archlinux/blob/master/.github/workflows/build/Dockerfile
|
|
|
|
# * https://github.com/WhyNotHugo/docker-makepkg/blob/main/Dockerfile
|
2021-05-13 15:44:34 +02:00
|
|
|
|
|
|
|
FROM archlinux:base-devel
|
|
|
|
|
|
|
|
# Add de-p1st mirror ...
|
|
|
|
RUN printf '\n[de-p1st]\nSigLevel = Optional TrustAll\nServer = https://arch.p1st.de\n' >> /etc/pacman.conf
|
|
|
|
# ... and update mirrors + packages
|
2021-06-12 11:55:25 +02:00
|
|
|
RUN pacman -Syu --noconfirm && \
|
2021-06-14 14:46:29 +02:00
|
|
|
pacman -S --noconfirm archiso openssh
|
2021-05-13 15:44:34 +02:00
|
|
|
|
|
|
|
# Set packager
|
|
|
|
RUN sed --in-place 's|^#PACKAGER=.*$|PACKAGER="Daniel Langbein <daniel@systemli.org>"|' /etc/makepkg.conf
|
|
|
|
# Store built packages in /out/
|
|
|
|
RUN sed --in-place 's|^#PKGDEST=.*$|PKGDEST=/out|' /etc/makepkg.conf
|
|
|
|
|
2021-06-12 11:55:25 +02:00
|
|
|
# Create a normal user to build the ISO
|
2021-05-13 15:44:34 +02:00
|
|
|
RUN useradd --create-home build
|
|
|
|
RUN echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
|
|
|
|
|
|
# Create output directory
|
|
|
|
RUN mkdir -p /out
|
|
|
|
|
|
|
|
# Continue execution (and CMD) as notroot:
|
|
|
|
USER build
|
|
|
|
WORKDIR /home/build
|
|
|
|
|
|
|
|
# Auto-fetch GPG keys (to check signatures):
|
|
|
|
RUN mkdir .gnupg && \
|
|
|
|
echo "keyserver-options auto-key-retrieve" > .gnupg/gpg.conf
|
|
|
|
|
|
|
|
COPY run.sh /home/build/run.sh
|
|
|
|
ENTRYPOINT [ "/bin/bash", "/home/build/run.sh" ]
|
|
|
|
# Default arguments passed to /run.sh
|
2021-06-12 11:55:25 +02:00
|
|
|
# CMD [ "clean" ]
|