forked from cdrx/docker-pyinstaller
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-py3-i386
62 lines (55 loc) · 1.63 KB
/
Dockerfile-py3-i386
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
FROM i386/ubuntu:18.04
ARG PYTHON_VERSION=3.9.6
ARG PYINSTALLER_VERSION=4.2
ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
ENV PYENV_VERSION=${PYTHON_VERSION}
# set compilation environment for python
ENV PYTHON_CONFIGURE_OPTS=--enable-shared
ENV CPPFLAGS=-O2
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 \
openssl \
#optional libraries
libgdbm-dev \
# libgdbm5 for ubuntu 18.04
# libgdbm6 for ubuntu 20.04
libgdbm5 \
uuid-dev \
#upx # why is this needed?
upx \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& . ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> ~/.bashrc \
&& . ~/.bashrc \
# install python
&& 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"]