Skip to content

Commit c26aa5f

Browse files
committed
saner
1 parent 3ec9685 commit c26aa5f

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

Dockerfile

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,71 @@
11
#FROM ghcr.io/fwcd/archlinux:latest AS bootstrap
2-
FROM azathothas/archlinux:latest AS bootstrap
2+
FROM pkgforge/archlinux:latest AS bootstrap
33

4+
#------------------------------------------------------------------------------------#
5+
##Build Args
46
ARG TARGETARCH
57
ARG TARGETVARIANT
8+
#------------------------------------------------------------------------------------#
69

7-
# Set up the bootstrap tree
10+
#------------------------------------------------------------------------------------#
11+
##Bootstrap
812
COPY /bootstrap/any /
913
COPY /bootstrap/${TARGETARCH}${TARGETVARIANT} /
10-
11-
# Set up the initial rootfs tree
1214
COPY /rootfs/any /rootfs
1315
COPY /rootfs/${TARGETARCH}${TARGETVARIANT} /rootfs
16+
#------------------------------------------------------------------------------------#
1417

15-
# Install the base packages
16-
RUN cat /etc/bootstrap-packages.txt | xargs pacstrap-docker /rootfs
18+
#------------------------------------------------------------------------------------#
19+
##Install the base packages
20+
RUN cat /etc/bootstrap-packages.txt | xargs pacstrap-docker /rootfs 2>/dev/null
21+
#------------------------------------------------------------------------------------#
1722

23+
#------------------------------------------------------------------------------------#
24+
##Fixes
1825
# Fix marginal trust errors on Arch Linux ARM
19-
RUN sed -i 's/^\(GPG_PACMAN=(.*\))/\1 --allow-weak-key-signatures)/g' /rootfs/usr/bin/pacman-key
20-
21-
# Remove the current pacman database (usually outdated very soon anyway)
22-
RUN rm /rootfs/var/lib/pacman/sync/*
26+
RUN <<EOS
27+
set +e
28+
sed -i 's/^\(GPG_PACMAN=(.*\))/\1 --allow-weak-key-signatures)/g' "/rootfs/usr/bin/pacman-key" 2>/dev/null || true
29+
rm /rootfs/var/lib/pacman/sync/* 2>/dev/null || true
30+
sed 's/DownloadUser/#DownloadUser/g' -i "/etc/pacman.conf" 2>/dev/null || true
31+
EOS
32+
#------------------------------------------------------------------------------------#
2333

34+
#------------------------------------------------------------------------------------#
35+
##Copy the bootstrapped rootfs
2436
FROM scratch
25-
26-
# Copy the bootstrapped rootfs
2737
COPY --from=bootstrap /rootfs /
38+
#------------------------------------------------------------------------------------#
2839

29-
# Set up locale
30-
ENV LANG=en_US.UTF-8
31-
RUN locale-gen
32-
40+
#------------------------------------------------------------------------------------#
41+
##Initialize
3342
# Set up pacman-key without distributing the lsign key
3443
# See https://gitlab.archlinux.org/archlinux/archlinux-docker/-/blob/301942f9e5995770cb5e4dedb4fe9166afa4806d/README.md#principles
3544
# Source: https://gitlab.archlinux.org/archlinux/archlinux-docker/-/blob/301942f9e5995770cb5e4dedb4fe9166afa4806d/Makefile#L22
36-
RUN pacman-key --init && \
37-
pacman-key --populate && \
38-
bash -c "rm -rf etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}*"
45+
RUN <<EOS
46+
set +e
47+
pacman-key --init 2>/dev/null || true
48+
pacman-key --populate 2>/dev/null || true
49+
bash -c "rm -rf etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}*" 2>/dev/null || true
50+
sed 's/DownloadUser/#DownloadUser/g' -i "/etc/pacman.conf" 2>/dev/null || true
51+
EOS
52+
#------------------------------------------------------------------------------------#
53+
54+
#------------------------------------------------------------------------------------#
55+
#ENV
56+
RUN <<EOS
57+
#Locale
58+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/environment"
59+
echo "en_US.UTF-8 UTF-8" | tee -a "/etc/locale.gen"
60+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
61+
locale-gen "en_US.UTF-8"
62+
EOS
63+
ENV LANG="en_US.UTF-8"
64+
ENV LANGUAGE="en_US:en"
65+
ENV LC_ALL="en_US.UTF-8"
66+
#------------------------------------------------------------------------------------#
3967

68+
#------------------------------------------------------------------------------------#
69+
#Entrypoint
4070
CMD ["/usr/bin/bash"]
71+
#------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)