musl.Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # use the prebuid base builder to speed up: ghcr.io/newfuture/nuitka-buider:musl-master
  2. ARG BUILDER=base-builder
  3. ARG PYTHON_VERSION=3.8
  4. ARG NUITKA_VERSION=main
  5. # build with alpine3.12 (musl-libc 1.1.24)
  6. FROM python:${PYTHON_VERSION}-alpine3.12 AS base-builder
  7. RUN apk add --update --no-cache gcc ccache build-base ca-certificates patchelf \
  8. && update-ca-certificates \
  9. && rm -rf /var/lib/apt/lists/* /var/cache/* /tmp/* /var/log/*
  10. ARG NUITKA_VERSION
  11. RUN python3 -m pip install --no-cache-dir --prefer-binary \
  12. "https://github.com/Nuitka/Nuitka/archive/${NUITKA_VERSION}.zip" \
  13. --disable-pip-version-check \
  14. # --break-system-packages \
  15. && rm -rf /var/cache/* /tmp/* /var/log/* /root/.cache
  16. WORKDIR /app
  17. FROM ${BUILDER} AS builder
  18. COPY run.py .github/patch.py .
  19. COPY ddns ddns
  20. ARG GITHUB_REF_NAME
  21. ENV GITHUB_REF_NAME=${GITHUB_REF_NAME}
  22. RUN python3 patch.py
  23. RUN python3 -O -m nuitka run.py \
  24. --remove-output \
  25. --lto=yes
  26. RUN cp dist/ddns /bin/ddns && cp dist/ddns /ddns
  27. # export the binary
  28. FROM scratch AS export
  29. COPY --from=builder /ddns /ddns