39 lines
1 KiB
Docker
39 lines
1 KiB
Docker
ARG ARCH=""
|
|
ARG ALPINE_VERSION="3.12"
|
|
|
|
FROM ${ARCH}python:${ALPINE_VERSION}-alpine
|
|
|
|
ARG PYINSTALLER_TAG
|
|
ENV PYINSTALLER_TAG ${PYINSTALLER_TAG:-"v6.10.0"}
|
|
|
|
# Official Python base image is needed or some applications will segfault.
|
|
# PyInstaller needs zlib-dev, gcc, libc-dev, and musl-dev
|
|
RUN apk --update --no-cache add \
|
|
zlib-dev \
|
|
musl-dev \
|
|
libc-dev \
|
|
libffi-dev \
|
|
gcc \
|
|
g++ \
|
|
git \
|
|
pwgen \
|
|
&& pip install --upgrade pip
|
|
|
|
# Install pycrypto so --key can be used with PyInstaller
|
|
RUN pip install \
|
|
pycrypto
|
|
|
|
# Build bootloader for alpine
|
|
RUN git clone --depth 1 --single-branch --branch ${PYINSTALLER_TAG} https://github.com/pyinstaller/pyinstaller.git /tmp/pyinstaller \
|
|
&& cd /tmp/pyinstaller/bootloader \
|
|
&& CFLAGS="-Wno-stringop-overflow -Wno-stringop-truncation" python ./waf configure all \
|
|
&& pip install .. \
|
|
&& rm -Rf /tmp/pyinstaller
|
|
|
|
VOLUME /src
|
|
WORKDIR /src
|
|
|
|
ADD ./bin /pyinstaller
|
|
RUN chmod a+x /pyinstaller/*
|
|
|
|
ENTRYPOINT ["/pyinstaller/pyinstaller.sh"]
|