-
Notifications
You must be signed in to change notification settings - Fork 243
/
Dockerfile-py3-amd64
65 lines (59 loc) · 2.16 KB
/
Dockerfile-py3-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
57
58
59
60
61
62
63
64
65
FROM ubuntu:12.04
SHELL ["/bin/bash", "-i", "-c"]
ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6
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 \
libgdbm3 \
uuid-dev \
#upx
upx \
# required because openSSL on Ubuntu 12.04 and 14.04 run out of support versions of OpenSSL
&& mkdir openssl \
&& cd openssl \
# latest version, there won't be anything newer for this
&& wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz \
&& tar -xzvf openssl-1.0.2u.tar.gz \
&& cd openssl-1.0.2u \
&& ./config --prefix=$HOME/openssl --openssldir=$HOME/openssl shared zlib \
&& make \
&& make install \
# 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
&& PATH="$HOME/openssl:$PATH" CPPFLAGS="-O2 -I$HOME/openssl/include" CFLAGS="-I$HOME/openssl/include/" LDFLAGS="-L$HOME/openssl/lib -Wl,-rpath,$HOME/openssl/lib" LD_LIBRARY_PATH=$HOME/openssl/lib:$LD_LIBRARY_PATH LD_RUN_PATH="$HOME/openssl/lib" CONFIGURE_OPTS="--with-openssl=$HOME/openssl" 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"]