@@ -22,6 +22,27 @@ ENV HOME /root
22
22
# Add bash enhancements
23
23
COPY ./paddle/scripts/docker/root/ /root/
24
24
25
+ # Prepare packages for Python
26
+ RUN apt-get update && \
27
+ apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
28
+ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
29
+ xz-utils tk-dev libffi-dev liblzma-dev
30
+
31
+ # Install Python3.6
32
+ RUN mkdir -p /root/python_build/ && wget -q https://www.sqlite.org/2018/sqlite-autoconf-3250300.tar.gz && \
33
+ tar -zxf sqlite-autoconf-3250300.tar.gz && cd sqlite-autoconf-3250300 && \
34
+ ./configure -prefix=/usr/local && make -j8 && make install && cd ../ && rm sqlite-autoconf-3250300.tar.gz && \
35
+ wget -q https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz && \
36
+ tar -xzf Python-3.6.0.tgz && cd Python-3.6.0 && \
37
+ CFLAGS="-Wformat" ./configure --prefix=/usr/local/ --enable-shared > /dev/null && \
38
+ make -j8 > /dev/null && make altinstall > /dev/null
39
+
40
+ # Install Python3.7
41
+ RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz && \
42
+ tar -xzf Python-3.7.0.tgz && cd Python-3.7.0 && \
43
+ CFLAGS="-Wformat" ./configure --prefix=/usr/local/ --enable-shared > /dev/null && \
44
+ make -j8 > /dev/null && make altinstall > /dev/null
45
+
25
46
RUN apt-get update && \
26
47
apt-get install -y --allow-downgrades patchelf \
27
48
python3 python3-dev python3-pip \
@@ -74,6 +95,12 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
74
95
RUN pip3 install -U wheel && \
75
96
pip3 install -U docopt PyYAML sphinx==1.5.6 && \
76
97
pip3 install sphinx-rtd-theme==0.1.9 recommonmark && \
98
+ pip3.6 install -U wheel && \
99
+ pip3.6 install -U docopt PyYAML sphinx==1.5.6 && \
100
+ pip3.6 install sphinx-rtd-theme==0.1.9 recommonmark && \
101
+ pip3.7 install -U wheel && \
102
+ pip3.7 install -U docopt PyYAML sphinx==1.5.6 && \
103
+ pip3.7 install sphinx-rtd-theme==0.1.9 recommonmark && \
77
104
easy_install -U pip && \
78
105
pip install -U pip setuptools wheel && \
79
106
pip install -U docopt PyYAML sphinx==1.5.6 && \
@@ -82,22 +109,34 @@ RUN pip3 install -U wheel && \
82
109
RUN pip3 install 'pre-commit==1.10.4' 'ipython==5.3.0' && \
83
110
pip3 install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
84
111
pip3 install opencv-python && \
112
+ pip3.6 install 'pre-commit==1.10.4' 'ipython==5.3.0' && \
113
+ pip3.6 install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
114
+ pip3.6 install opencv-python && \
115
+ pip3.7 install 'pre-commit==1.10.4' 'ipython==5.3.0' && \
116
+ pip3.7 install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
117
+ pip3.7 install opencv-python && \
85
118
pip install 'pre-commit==1.10.4' 'ipython==5.3.0' && \
86
119
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
87
120
pip install opencv-python
88
121
89
122
# For docstring checker
90
123
RUN pip3 install pylint pytest astroid isort
124
+ RUN pip3.6 install pylint pytest astroid isort
125
+ RUN pip3.7 install pylint pytest astroid isort
91
126
RUN pip install pylint pytest astroid isort LinkChecker
92
127
93
128
COPY ./python/requirements.txt /root/
94
129
RUN pip3 install -r /root/requirements.txt
130
+ RUN pip3.6 install -r /root/requirements.txt
131
+ RUN pip3.7 install -r /root/requirements.txt
95
132
RUN pip install -r /root/requirements.txt
96
133
97
134
# To fix https://github.com/PaddlePaddle/Paddle/issues/1954, we use
98
135
# the solution in https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
99
136
RUN apt-get install -y libssl-dev libffi-dev
100
137
RUN pip3 install certifi urllib3[secure]
138
+ RUN pip3.6 install certifi urllib3[secure]
139
+ RUN pip3.7 install certifi urllib3[secure]
101
140
RUN pip install certifi urllib3[secure]
102
141
103
142
0 commit comments