Files
DDNS/docker/musl.Dockerfile
T
New FutureandCopilot baf1fdc30c refact(py): Refactor structure (#481)
* 目录结构重构
* update config
* rename dns to provider
* patch version info
* remove version replace
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add ENV GITHUB_REF_NAME to docker build
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-16 01:41:34 +08:00

37 lines
1.1 KiB
Docker

# use the prebuid base builder to speed up: ghcr.io/newfuture/nuitka-buider:musl-master
ARG BUILDER=base-builder
ARG PYTHON_VERSION=3.8
ARG NUITKA_VERSION=main
# build with alpine3.12 (musl-libc 1.1.24)
FROM python:${PYTHON_VERSION}-alpine3.12 AS base-builder
RUN apk add --update --no-cache gcc ccache build-base ca-certificates patchelf \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/* /var/cache/* /tmp/* /var/log/*
ARG NUITKA_VERSION
RUN python3 -m pip install --no-cache-dir --prefer-binary \
"https://github.com/Nuitka/Nuitka/archive/${NUITKA_VERSION}.zip" \
--disable-pip-version-check \
# --break-system-packages \
&& rm -rf /var/cache/* /tmp/* /var/log/* /root/.cache
WORKDIR /app
FROM ${BUILDER} AS builder
COPY run.py .github/patch.py .
COPY ddns ddns
ARG GITHUB_REF_NAME
ENV GITHUB_REF_NAME=${GITHUB_REF_NAME}
RUN python3 patch.py
RUN python3 -O -m nuitka run.py \
--remove-output \
--lto=yes
RUN cp dist/ddns /bin/ddns && cp dist/ddns /ddns
# export the binary
FROM scratch AS export
COPY --from=builder /ddns /ddns