Dockerfile.base-devel 1.39 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# We're using a multistage Docker build here in order to allow us to release a self-verifying
# Docker image when built on the official Docker infrastructure.
# They require us to verify the source integrity in some way while making sure that this is a
# reproducible build.
# See https://github.com/docker-library/official-images#image-build
# In order to achieve this, we externally host the rootfs archives and their checksums and then
# just download and verify it in the first stage of this Dockerfile.
# The second stage is for actually configuring the system a little bit.
# Some templating is done in order to allow us to easily build different configurations and to
# allow us to automate the releaes process.
11
FROM alpine:3.12 AS verify
12
13
RUN apk add --no-cache curl tar zstd

14
15
16
# https://gitlab.archlinux.org/archlinux/archlinux-docker/-/releases/v20220515.0.56491
RUN ROOTFS="$(curl -sOJL -w "%{filename_effective}" "https://gitlab.archlinux.org/archlinux/archlinux-docker/-/package_files/2492/download")" && \
    echo "45b395c68f13df88e1a8ee300f5d217b8c81d4eae104309010c4a7d7021402e0  base-devel-20220515.0.56491.tar.zst" > /tmp/rootfs.tar.sha256 && \
17
18
    cat /tmp/rootfs.tar.sha256 && \
    sha256sum -c /tmp/rootfs.tar.sha256 && \
19
    mkdir /rootfs && \
20
    tar -C /rootfs --extract --file "${ROOTFS}"
21
22
23
24

FROM scratch AS root
COPY --from=verify /rootfs/ /

25
RUN ldconfig
26
27
28

ENV LANG=en_US.UTF-8
CMD ["/usr/bin/bash"]