forked from six8/pyinstaller-alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (29 loc) · 977 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ARG ARCH=""
ARG ALPINE_VERSION="3.6"
FROM ${ARCH}python:${ALPINE_VERSION}-alpine
ARG PYINSTALLER_TAG
ENV PYINSTALLER_TAG ${PYINSTALLER_TAG:-"v3.4"}
# 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 \
gcc \
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" python ./waf configure --no-lsb all \
&& pip install .. \
&& rm -Rf /tmp/pyinstaller
VOLUME /src
WORKDIR /src
ADD ./bin /pyinstaller
RUN chmod a+x /pyinstaller/*
ENTRYPOINT ["/pyinstaller/pyinstaller.sh"]