Skip to content

Commit e4d90c4

Browse files
committed
Update image structure based on design doc updates
1 parent 3bc39b7 commit e4d90c4

7 files changed

+101
-107
lines changed

Dockerfile.base

+26-23
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ RUN apt-get -y install \
5151
subversion \
5252
zlib1g-dev
5353

54-
5554
# LaTeX -- split to reduce image layer size
5655
RUN apt-get -y install \
5756
texlive-fonts-extra
@@ -85,48 +84,52 @@ RUN apt-get -y install \
8584
fonts-hanazono \
8685
xindy
8786

88-
# pyenv extra requirements
89-
# https://github.com/pyenv/pyenv/wiki/Common-build-problems
87+
# asdf Python extra requirements
88+
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
9089
RUN apt-get install -y \
9190
liblzma-dev \
9291
libncurses5-dev \
9392
libncursesw5-dev \
9493
libssl-dev \
94+
libxmlsec1-dev \
9595
llvm \
9696
make \
9797
python-openssl \
9898
tk-dev \
9999
wget \
100100
xz-utils
101101

102+
# asdf nodejs extra requirements
103+
# https://github.com/asdf-vm/asdf-nodejs#linux-debian
104+
RUN apt install -y \
105+
dirmngr \
106+
gpg
107+
108+
# asdf Golang extra requirements
109+
# https://github.com/kennyp/asdf-golang#linux-debian
110+
RUN apt install -y \
111+
coreutils
112+
102113
# UID and GID from readthedocs/user
103114
RUN groupadd --gid 205 docs
104115
RUN useradd -m --uid 1005 --gid 205 docs
105116

106117
USER docs
107118
WORKDIR /home/docs
108119

109-
# Install pyenv
110-
RUN wget https://github.com/pyenv/pyenv/archive/master.zip && \
111-
unzip master.zip && \
112-
rm -f master.zip && \
113-
mv pyenv-master ~docs/.pyenv
114-
ENV PYENV_ROOT /home/docs/.pyenv
115-
ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin
120+
# Install asdf
121+
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --depth 1 --branch v0.8.1
122+
RUN echo ". /home/docs/.asdf/asdf.sh" >> ~/.bashrc
123+
RUN echo ". /home/docs/.asdf/completions/asdf.bash" >> ~/.bashrc
116124

117-
# Install nodenv
118-
RUN wget https://github.com/nodenv/nodenv/archive/master.zip && \
119-
unzip master.zip && \
120-
rm -f master.zip && \
121-
mv nodenv-master ~docs/.nodenv
122-
RUN cd ~/.nodenv && src/configure && make -C src
123-
ENV PATH /home/docs/.nodenv/bin:$PATH
125+
# Activate asdf in current session
126+
RUN . /home/docs/.asdf/asdf.sh && \
127+
. /home/docs/.asdf/completions/asdf.bash
124128

125-
# Install node-build
126-
RUN mkdir /home/docs/.nodenv/plugins
127-
RUN wget https://github.com/nodenv/node-build/archive/master.zip && \
128-
unzip master.zip && \
129-
rm -f master.zip && \
130-
mv node-build-master ~/.nodenv/plugins/node-build
129+
# Install asdf plugins
130+
RUN asdf plugin-add python
131+
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
132+
RUN asdf plugin-add rust https://github.com/code-lever/asdf-rust.git
133+
RUN asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
131134

132135
CMD ["/bin/bash"]

Dockerfile.conda47

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
# Read the Docs - ubuntu20-conda47
22
FROM readthedocs/build:ubuntu20-base
33

4-
# Install Conda
5-
# Note: 4.7.12.1 drastically increases memory usage
6-
ENV RTD_CONDA_VERSION 4.6.14
4+
# Define Python versions to be installed via asdf
5+
ENV RTD_PYTHON_VERSION miniconda3-4.7.12
76

8-
WORKDIR /home/docs
7+
# Labels for external usage
8+
LABEL python.version=$RTD_PYTHON_VERSION
99

1010
# Install supported Python versions
11-
RUN pyenv install miniconda3-$RTD_CONDA_VERSION && \
12-
pyenv global miniconda3-$RTD_CONDA_VERSION
13-
14-
WORKDIR /tmp
15-
16-
ENV RTD_MAMBA_VERSION 0.8.2
17-
RUN pyenv local miniconda3-$RTD_CONDA_VERSION && \
18-
pyenv exec conda install --channel conda-forge mamba==$RTD_MAMBA_VERSION
19-
20-
WORKDIR /home/docs
21-
22-
# Adding labels for external usage
23-
LABEL conda.version=$RTD_CONDA_VERSION
11+
RUN asdf install python $RTD_PYTHON_VERSION && \
12+
asdf global python $RTD_PYTHON_VERSION
2413

2514
CMD ["/bin/bash"]

Dockerfile.custom

-36
This file was deleted.

Dockerfile.mamba410

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Read the Docs - ubuntu20-mamba410
2+
FROM readthedocs/build:ubuntu20-base
3+
4+
# Define Python versions to be installed via asdf
5+
ENV RTD_PYTHON_VERSION mambaforge-4.10.1-5
6+
7+
# Labels for external usage
8+
LABEL python.version=$RTD_PYTHON_VERSION
9+
10+
# Install supported Python versions
11+
RUN asdf install python $RTD_PYTHON_VERSION && \
12+
asdf global python $RTD_PYTHON_VERSION
13+
14+
CMD ["/bin/bash"]

Dockerfile.py27

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
# Read the Docs - ubuntu20-py27
22
FROM readthedocs/build:ubuntu20-base
33

4-
# Define Python versions to be installed via pyenv
5-
ENV RTD_PYTHON_VERSION_27 2.7.18
4+
# Define Python versions to be installed via asdf
5+
ENV RTD_PYTHON_VERSION 2.7.18
6+
ENV RTD_PIP_VERSION 20.0.1
7+
ENV RTD_SETUPTOOLS_VERSION 44.0.0
8+
ENV RTD_VIRTUALENV_VERSION 16.7.9
69

7-
# Install supported Python versions
8-
RUN pyenv install $RTD_PYTHON_VERSION_27 && \
9-
pyenv global $RTD_PYTHON_VERSION_27
10+
# Labels for external usage
11+
LABEL python.version=$RTD_PYTHON_VERSION
12+
LABEL python.pip=$RTD_PIP_VERSION
13+
LABEL python.setuptools=$SETUPTOOLS_VERSION
14+
LABEL python.virtualenv=$VIRTUALENV_VERSION
1015

11-
WORKDIR /tmp
16+
# Install supported Python versions
17+
RUN asdf install python $RTD_PYTHON_VERSION && \
18+
asdf global python $RTD_PYTHON_VERSION
1219

1320
# Python2 dependencies are hardcoded because Python2 is
1421
# deprecated. Updating them to their latest versions may raise
1522
# incompatibility issues.
16-
RUN pyenv local $RTD_PYTHON_VERSION_27 && \
17-
pyenv exec pip install --no-cache-dir -U pip==20.0.1 && \
18-
pyenv exec pip install --no-cache-dir -U setuptools==44.0.0 && \
19-
pyenv exec pip install --no-cache-dir virtualenv==16.7.9
20-
21-
# Adding labels for external usage
22-
LABEL python.version_27=$PYTHON_VERSION_27
23+
RUN pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
24+
pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
25+
pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
2326

2427
CMD ["/bin/bash"]

Dockerfile.py38

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Read the Docs - ubuntu20-py39
2+
FROM readthedocs/build:ubuntu20-base
3+
4+
# Define Python versions to be installed via asdf
5+
ENV RTD_PYTHON_VERSION 3.8.11
6+
ENV RTD_PIP_VERSION 21.2.4
7+
ENV RTD_SETUPTOOLS_VERSION 57.4.0
8+
ENV RTD_VIRTUALENV_VERSION 20.7.2
9+
10+
# Labels for external usage
11+
LABEL python.version=$RTD_PYTHON_VERSION
12+
LABEL python.pip=$RTD_PIP_VERSION
13+
LABEL python.setuptools=$SETUPTOOLS_VERSION
14+
LABEL python.virtualenv=$VIRTUALENV_VERSION
15+
16+
# Install supported Python versions
17+
RUN asdf install python $RTD_PYTHON_VERSION && \
18+
asdf global python $RTD_PYTHON_VERSION
19+
20+
RUN pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
21+
pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
22+
pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
23+
24+
CMD ["/bin/bash"]

Dockerfile.py39

+15-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
# Read the Docs - ubuntu20-py39
22
FROM readthedocs/build:ubuntu20-base
33

4-
ENV RTD_PYTHON_VERSION_39 3.9.0
4+
# Define Python versions to be installed via asdf
5+
ENV RTD_PYTHON_VERSION 3.9.6
6+
ENV RTD_PIP_VERSION 21.2.4
7+
ENV RTD_SETUPTOOLS_VERSION 57.4.0
8+
ENV RTD_VIRTUALENV_VERSION 20.7.2
59

6-
# Install supported Python versions
7-
RUN pyenv install $RTD_PYTHON_VERSION_39 && \
8-
pyenv global $RTD_PYTHON_VERSION_39
9-
10-
WORKDIR /tmp
11-
12-
ENV RTD_PIP_VERSION 21.0.1
13-
ENV RTD_SETUPTOOLS_VERSION 45.1.0
14-
ENV RTD_VIRTUALENV_VERSION 20.4.3
15-
16-
RUN pyenv local $RTD_PYTHON_VERSION_39 && \
17-
pyenv exec pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
18-
pyenv exec pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
19-
pyenv exec pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
20-
21-
# Adding labels for external usage
22-
LABEL python.version_39=$PYTHON_VERSION_39
10+
# Labels for external usage
11+
LABEL python.version=$RTD_PYTHON_VERSION
2312
LABEL python.pip=$RTD_PIP_VERSION
2413
LABEL python.setuptools=$SETUPTOOLS_VERSION
2514
LABEL python.virtualenv=$VIRTUALENV_VERSION
2615

16+
# Install supported Python versions
17+
RUN asdf install python $RTD_PYTHON_VERSION && \
18+
asdf global python $RTD_PYTHON_VERSION
19+
20+
RUN pip install --no-cache-dir -U pip==$RTD_PIP_VERSION && \
21+
pip install --no-cache-dir -U setuptools==$RTD_SETUPTOOLS_VERSION && \
22+
pip install --no-cache-dir virtualenv==$RTD_VIRTUALENV_VERSION
23+
2724
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)