Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-py-build . /
COPY --from=stagex/core-py-flit . /
COPY --from=stagex/core-py-installer . /
COPY --from=stagex/core-py-packaging . /
COPY --from=stagex/core-py-pep517 . /
COPY --from=stagex/core-py-setuptools . /
COPY --from=stagex/core-py-toml . /
COPY --from=stagex/core-py-wheel . /
COPY --from=stagex/core-python . /
COPY --from=stagex/core-zlib . /
ADD fetch/py-setuptools-scm-${VERSION}.tar.gz .
WORKDIR /setuptools-scm-${VERSION}/
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}
RUN --network=none <<-EOF
set -eu
python -m build --wheel --skip-dependency-check --no-isolation
python -m installer --destdir=/rootfs dist/*.whl
install -Dm0644 -t /rootfs/usr/share/licenses/py-setuptools-scm LICENSE
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /