Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-openssl . /
COPY --from=stagex/core-zlib . /
COPY --from=stagex/core-bzip2 . /
COPY --from=stagex/core-ncurses . /
COPY --from=stagex/core-sqlite3 . /
COPY --from=stagex/core-libffi . /
ADD fetch/python-${VERSION}.tar.xz .
WORKDIR /Python-${VERSION}
ENV SOURCE_DATE_EPOCH=1
ENV PYTHONHASHSEED=0
ENV PYTHONDONTWRITEBYTECODE=1
RUN --network=none <<-EOF
set -eux
./configure \
--prefix=/usr \
--enable-shared \
--with-computed-gotos \
--without-ensurepip
make -j "$(nproc)"
make DESTDIR=/rootfs install
ln -s /usr/bin/python3 /rootfs/usr/bin/python
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /