@@ -6,28 +6,6 @@ ENV DEBIAN_FRONTEND noninteractive
6
6
ENV APPDIR /app
7
7
ENV LANG C.UTF-8
8
8
9
- # Versions, and expose labels for external usage
10
- ENV RTD_PYTHON_VERSION_27 2.7.16
11
- ENV RTD_PYTHON_VERSION_35 3.5.7
12
- ENV RTD_PYTHON_VERSION_36 3.6.8
13
- ENV RTD_PYTHON_VERSION_37 3.7.3
14
- ENV RTD_PYTHON_VERSION_38 3.8.0
15
- ENV RTD_PYPY_VERSION_35 pypy3.5-7.0.0
16
-
17
- # Note: 4.7.12.1 drastically increases memory usage
18
- ENV RTD_CONDA_VERSION 4.6.14
19
-
20
- ENV RTD_PIP_VERSION 20.0.1
21
- ENV RTD_SETUPTOOLS_VERSION 45.1.0
22
- ENV RTD_VIRTUALENV_VERSION 16.7.9
23
- LABEL python.version_27=$RTD_PYTHON_VERSION_27
24
- LABEL python.version_35=$RTD_PYTHON_VERSION_35
25
- LABEL python.version_36=$RTD_PYTHON_VERSION_36
26
- LABEL python.version_37=$RTD_PYTHON_VERSION_37
27
- LABEL python.version_38=$RTD_PYTHON_VERSION_38
28
- LABEL pypy.version_35=$RTD_PYPY_VERSION_35
29
- LABEL conda.version=$RTD_CONDA_VERSION
30
-
31
9
# System dependencies
32
10
RUN apt-get -y update
33
11
RUN apt-get -y install \
@@ -136,6 +114,7 @@ RUN apt-get -y install \
136
114
swig
137
115
138
116
# Install Python tools/libs
117
+ ENV RTD_VIRTUALENV_VERSION 16.7.9
139
118
RUN apt-get -y install \
140
119
python-pip \
141
120
&& pip install -U \
@@ -157,12 +136,6 @@ RUN useradd -m --uid 1005 --gid 205 docs
157
136
USER docs
158
137
WORKDIR /home/docs
159
138
160
- # Install Conda
161
- RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh
162
- RUN bash Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh -b -p /home/docs/.conda/
163
- ENV PATH $PATH:/home/docs/.conda/bin
164
- RUN rm -f Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh
165
-
166
139
# Install pyenv
167
140
RUN wget https://github.com/pyenv/pyenv/archive/master.zip
168
141
RUN unzip master.zip && \
@@ -171,6 +144,14 @@ RUN unzip master.zip && \
171
144
ENV PYENV_ROOT /home/docs/.pyenv
172
145
ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin
173
146
147
+ # Define Python versions to be installed via pyenv
148
+ ENV RTD_PYTHON_VERSION_27 2.7.16
149
+ ENV RTD_PYTHON_VERSION_35 3.5.7
150
+ ENV RTD_PYTHON_VERSION_36 3.6.8
151
+ ENV RTD_PYTHON_VERSION_37 3.7.3
152
+ ENV RTD_PYTHON_VERSION_38 3.8.0
153
+ ENV RTD_PYPY_VERSION_35 pypy3.5-7.0.0
154
+
174
155
# Install supported Python versions
175
156
RUN pyenv install $RTD_PYTHON_VERSION_27 && \
176
157
pyenv install $RTD_PYTHON_VERSION_38 && \
@@ -188,12 +169,17 @@ RUN pyenv install $RTD_PYTHON_VERSION_27 && \
188
169
189
170
WORKDIR /tmp
190
171
172
+ # Python2 dependencies are hardcoded because Python2 is
173
+ # deprecated. Updating them to their latest versions may raise
174
+ # incompatibility issues.
191
175
RUN pyenv local $RTD_PYTHON_VERSION_27 && \
192
176
pyenv exec pip install --no-cache-dir -U pip==20.0.1 && \
193
177
pyenv exec pip install --no-cache-dir -U setuptools==44.0.0 && \
194
178
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
195
179
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv==16.7.9
196
180
181
+ ENV RTD_PIP_VERSION 20.0.1
182
+ ENV RTD_SETUPTOOLS_VERSION 45.1.0
197
183
RUN pyenv local $RTD_PYTHON_VERSION_38 && \
198
184
pyenv exec pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
199
185
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
@@ -224,6 +210,27 @@ RUN pyenv local $RTD_PYPY_VERSION_35 && \
224
210
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
225
211
pyenv exec pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
226
212
213
+ # Install Conda
214
+ WORKDIR /home/docs
215
+ # Note: 4.7.12.1 drastically increases memory usage
216
+ ENV RTD_CONDA_VERSION 4.6.14
217
+ RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh
218
+ RUN bash Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh -b -p /home/docs/.conda/
219
+ ENV PATH $PATH:/home/docs/.conda/bin
220
+ RUN rm -f Miniconda2-${RTD_CONDA_VERSION}-Linux-x86_64.sh
221
+
227
222
WORKDIR /
228
223
224
+ # Adding labels for external usage
225
+ LABEL python.version_27=$PYTHON_VERSION_27
226
+ LABEL python.version_35=$PYTHON_VERSION_35
227
+ LABEL python.version_36=$PYTHON_VERSION_36
228
+ LABEL python.version_37=$PYTHON_VERSION_37
229
+ LABEL python.version_38=$PYTHON_VERSION_38
230
+ LABEL python.pip=$_PIP_VERSION
231
+ LABEL python.setuptools=$SETUPTOOLS_VERSION
232
+ LABEL python.virtualenv=$VIRTUALENV_VERSION
233
+ LABEL pypy.version_35=$PYPY_VERSION_35
234
+ LABEL conda.version=$CONDA_VERSION
235
+
229
236
CMD ["/bin/bash" ]
0 commit comments