deterministic docker support

This commit is contained in:
Lance R. Vick 2024-01-15 22:16:40 -08:00 committed by Kevin Nause
parent 347a33bd7e
commit 3e532d3e7d
3 changed files with 33 additions and 13 deletions

View file

@ -1,13 +1,24 @@
FROM local/stage0 as stage0
FROM debian as fetch
RUN apt update && apt install -y curl gcc
ADD . live-bootstrap
WORKDIR live-bootstrap
RUN ./download-distfiles.sh
RUN mv target/ /rootfs/
FROM scratch as build
COPY --from=fetch /rootfs .
ENV PATH=/bin
ADD target/ /
RUN ["/bootstrap-seeds/POSIX/x86/kaem-optional-seed"]
FROM build as install
ENV PATH=/bin:/usr/sbin:/usr/bin
RUN set -eux; \
rm -rf /usr/lib/python*/__pycache__; \
mkdir -p /rootfs/etc /rootfs/home/user; \
cp -R $(ls -d /etc/* | grep -v '\(resolv.conf\|hosts\)') /rootfs/etc/; \
cp -R lib usr bin var /rootfs/; \
echo "user:x:1000:" > /rootfs/etc/group; \
echo "user:x:1000:1000::/home/user:/bin/bash" > /rootfs/etc/passwd; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /
USER 1000:1000
ENTRYPOINT ["/bin/bash"]
ENV TZ=UTC
ENV LANG=C.UTF-8
ENV SOURCE_DATE_EPOCH=1
ENV KCONFIG_NOTIMESTAMP=1
ENV PS1="bootstrap$ "