Verified Commit 82e13a1d authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Compile entrypoint for compactness

parent 54a176bf
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
FROM debian:bookworm as entrypoint

RUN apt update && apt install -y \
    build-essential \
    libpython3-dev \
    patchelf \
    python3-venv

WORKDIR /build
RUN python3 -m venv venv
RUN venv/bin/python3 -m pip install nuitka
RUN --mount=source=entrypoint.py,target=entrypoint.py \
    venv/bin/python3 -m nuitka \
    --static-libpython=yes \
    --follow-imports \
    entrypoint.py


FROM debian:bookworm

LABEL org.opencontainers.image.title="Postfix"
@@ -10,5 +28,5 @@ ARG POSTFIX_VERSION=">=3.7.10,<<3.7.11"
RUN --mount=source=install.bash,target=/install /install "${POSTFIX_VERSION}"

COPY master.cf /etc/postfix/
COPY entrypoint.py /bin/entrypoint
COPY --from=entrypoint /build/entrypoint.bin /bin/entrypoint
ENTRYPOINT ["/bin/entrypoint"]