Skip to content

Commit

Permalink
Merge pull request #84 from rtfd/humitos/update-versions
Browse files Browse the repository at this point in the history
Update versions and cleanup Dockerfile
  • Loading branch information
humitos authored Jan 14, 2019
2 parents 89d4364 + 2ba16f0 commit e6f4f0b
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Read the Docs - Environment base
FROM ubuntu:18.04
MAINTAINER Read the Docs <support@readthedocs.com>
LABEL version="4.0.0"
LABEL mantainer="Read the Docs <support@readthedocs.com>"
LABEL version="5.0.0rc1"

ENV DEBIAN_FRONTEND noninteractive
ENV APPDIR /app
ENV LANG C.UTF-8

# Versions, and expose labels for exernal usage
ENV PYTHON_VERSION_27 2.7.14
ENV PYTHON_VERSION_35 3.5.5
ENV PYTHON_VERSION_36 3.6.4
ENV PYTHON_VERSION_37 3.7.1
ENV CONDA_VERSION 4.5.11
# Versions, and expose labels for external usage
ENV PYTHON_VERSION_27 2.7.15
ENV PYTHON_VERSION_36 3.6.8
ENV PYTHON_VERSION_37 3.7.2
ENV CONDA_VERSION 4.5.12
LABEL python.version_27=$PYTHON_VERSION_27
LABEL python.version_35=$PYTHON_VERSION_35
LABEL python.version_36=$PYTHON_VERSION_36
LABEL python.version_37=$PYTHON_VERSION_37
LABEL conda.version=$CONDA_VERSION
Expand All @@ -33,9 +31,10 @@ RUN apt-get -y install \
libsqlite3-dev libtiff5-dev libwebp-dev pandoc pkg-config zlib1g-dev

# pyenv extra requirements
# https://github.com/pyenv/pyenv/wiki/Common-build-problems
RUN apt-get install -y \
make libssl-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils \
tk-dev
tk-dev liblzma-dev python-openssl

# LaTeX -- split to reduce image layer size
RUN apt-get -y install texlive-fonts-extra
Expand All @@ -48,69 +47,72 @@ RUN apt-get -y install \
latex-cjk-chinese-arphic-gbsn00lp latex-cjk-chinese-arphic-gkai00mp \
fonts-symbola

# Install 'rsvg-convert' for SVG -> PDF conversion
# plantuml: is to support sphinxcontrib-plantuml
# https://pypi.org/project/sphinxcontrib-plantuml/
#
# imagemagick: is to support sphinx.ext.imgconverter
# http://www.sphinx-doc.org/en/master/usage/extensions/imgconverter.html
#
# rsvg-convert: is for SVG -> PDF conversion
# using Sphinx extension sphinxcontrib.rsvgconverter, see
# https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter
RUN apt-get -y install librsvg2-bin

# Install plantuml
RUN apt-get -y install plantuml
#
# swig: is required for different purposes
# https://github.com/rtfd/readthedocs-docker-images/issues/15
RUN apt-get -y install plantuml imagemagick librsvg2-bin swig

# Install Python tools/libs
RUN apt-get -y install python-pip && pip install -U virtualenv auxlib

# Install jsdoc and typedoc
RUN apt-get -y install nodejs npm && npm install --global jsdoc typedoc

# UID and GID from readthedocs/user
RUN groupadd --gid 205 docs
RUN useradd -m --uid 1005 --gid 205 docs

# Install jsdoc and typedoc
RUN apt-get -y install nodejs npm && npm install --global jsdoc typedoc

USER docs
WORKDIR /home/docs

# Install Conda
RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh
RUN bash Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh -b -p /home/docs/.conda/
ENV PATH $PATH:/home/docs/.conda/bin
RUN rm -f Miniconda2-${CONDA_VERSION}-Linux-x86_64.sh

# Install pyenv
RUN git clone --depth 1 https://github.com/yyuu/pyenv.git ~docs/.pyenv
RUN wget https://github.com/pyenv/pyenv/archive/master.zip
RUN unzip master.zip && \
rm -f master.zip && \
mv pyenv-master ~docs/.pyenv
ENV PYENV_ROOT /home/docs/.pyenv
ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin

# Install supported Python versions
RUN pyenv install $PYTHON_VERSION_27 && \
pyenv install $PYTHON_VERSION_37 && \
pyenv install $PYTHON_VERSION_36 && \
pyenv install $PYTHON_VERSION_35 && \
pyenv global \
$PYTHON_VERSION_27 \
$PYTHON_VERSION_37 \
$PYTHON_VERSION_36 \
$PYTHON_VERSION_35
$PYTHON_VERSION_36

WORKDIR /tmp

RUN pyenv local $PYTHON_VERSION_27 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install pandas matplotlib virtualenv
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv

RUN pyenv local $PYTHON_VERSION_37 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install pandas matplotlib virtualenv
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv

RUN pyenv local $PYTHON_VERSION_36 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install pandas matplotlib virtualenv

RUN pyenv local $PYTHON_VERSION_35 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install pandas matplotlib virtualenv
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv

WORKDIR /

Expand Down

0 comments on commit e6f4f0b

Please sign in to comment.