forked from cdrx/docker-pyinstaller
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-py3-focal-amd64
56 lines (50 loc) · 1.45 KB
/
Dockerfile-py3-focal-amd64
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM ubuntu:20.04
SHELL ["/bin/bash", "-i", "-c"]
ARG PYTHON_VERSION=3.7.9
ARG PYINSTALLER_VERSION=4.0
ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
ENV PYENV_VERSION=${PYTHON_VERSION}
COPY entrypoint-linux.sh /entrypoint.sh
RUN \
set -x \
# update system
&& apt-get update \
# install requirements
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
wget \
git \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev \
libffi-dev \
#optional libraries
libgdbm-dev \
libgdbm6 \
uuid-dev \
#upx
upx \
libssl-dev \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
# install python
&& CONFIGURE_OPTS=--enable-shared pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
&& pip install pyinstaller==$PYINSTALLER_VERSION \
&& mkdir /src/ \
&& chmod +x /entrypoint.sh
VOLUME /src/
WORKDIR /src/
ENTRYPOINT ["/entrypoint.sh"]