-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
47 lines (42 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM ghcr.io/archlinux/archlinux@sha256:efd5e81060f12fabd91f7bf6ba8dde33228312d460140c7fcccc0929ed70ece1
COPY run.sh /run.sh
RUN \
# * Fix script permissions
chmod 755 /run.sh && \
# * Install needed packages
pacman -Syyu --noconfirm --needed \
archlinux-keyring \
base-devel \
cmake \
sudo \
python \
binutils \
fakeroot \
git \
rsync && \
# * makepkg cannot (and should not) be run as root
useradd -m builder && \
# * Allow builder to run as root (to install dependencies)
echo "builder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder && \
# * cleanup
rm -Rf /var/cache/pacman/pkg/ && \
rm -rf ~/.cache/*
# * Continue execution as builder
USER builder
WORKDIR /home/builder
RUN \
# * Auto-fetch GPG keys (for checking signatures)
mkdir .gnupg && \
touch .gnupg/gpg.conf && \
echo "keyserver-options auto-key-retrieve" > .gnupg/gpg.conf && \
find ~/.gnupg -type f -exec chmod 600 {} \; && \
find ~/.gnupg -type d -exec chmod 700 {} \; && \
# * Install yay for AUR deps
git clone https://aur.archlinux.org/yay.git && \
cd yay && \
makepkg -sri --clean --noconfirm --needed && \
cd .. && rm -Rf yay
# Build the package
WORKDIR /pkg
ENTRYPOINT ["/bin/bash"]
CMD ["/run.sh"]