|
1 | 1 | # Read the Docs - Environment base
|
2 | 2 | FROM ubuntu:16.04
|
3 | 3 | MAINTAINER Read the Docs < [email protected]>
|
| 4 | +LABEL version="latest" |
4 | 5 |
|
5 | 6 | ENV DEBIAN_FRONTEND noninteractive
|
6 | 7 | ENV APPDIR /app
|
7 | 8 | ENV LANG C.UTF-8
|
8 | 9 |
|
9 | 10 | # System dependencies
|
10 | 11 | RUN apt-get -y update
|
11 |
| -RUN apt-get -y install vim software-properties-common python-setuptools \ |
12 |
| - python3-setuptools |
13 |
| - |
14 |
| -# from readthedocs.common |
15 |
| -RUN apt-get -y install bzr subversion git-core mercurial libpq-dev libxml2-dev \ |
16 |
| - libxslt-dev libxslt1-dev build-essential python-dev postgresql-client \ |
17 |
| - libmysqlclient-dev |
18 |
| - |
19 |
| -# from readthedocs.build |
20 |
| -RUN apt-get -y install libfreetype6 g++ sqlite libevent-dev libffi-dev \ |
21 |
| - libenchant1c2a curl texlive-full python-m2crypto python-matplotlib \ |
22 |
| - python-numpy python-scipy python-pandas graphviz graphviz-dev \ |
23 |
| - libgraphviz-dev pandoc doxygen latex-cjk-chinese-arphic-gbsn00lp \ |
24 |
| - latex-cjk-chinese-arphic-gkai00mp latex-cjk-chinese-arphic-bsmi00lp \ |
25 |
| - latex-cjk-chinese-arphic-bkai00mp python3 python3-dev python3-pip \ |
26 |
| - python3-matplotlib python3-numpy python3-scipy python3-pandas \ |
27 |
| - texlive-latex-extra texlive-fonts-recommended pkg-config libjpeg-dev \ |
28 |
| - libfreetype6-dev libtiff5-dev libjpeg8-dev zlib1g-dev liblcms2-dev \ |
29 |
| - libwebp-dev libcairo2-dev |
30 |
| - |
31 |
| -RUN easy_install3 pip |
32 |
| -RUN easy_install pip |
33 |
| -RUN pip3 install -U virtualenv auxlib |
34 |
| -RUN pip2 install -U virtualenv auxlib |
35 |
| -RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh |
36 |
| -RUN bash Miniconda2-latest-Linux-x86_64.sh -b -p /usr/local/miniconda/ |
37 |
| -RUN ln -s /usr/local/miniconda/bin/conda /usr/local/bin/conda |
| 12 | +RUN apt-get -y install vim software-properties-common |
| 13 | + |
| 14 | +# Install requirements |
| 15 | +RUN apt-get -y install \ |
| 16 | + bzr subversion git-core mercurial libpq-dev libxml2-dev libxslt-dev \ |
| 17 | + libxslt1-dev build-essential postgresql-client libmysqlclient-dev curl \ |
| 18 | + doxygen g++ graphviz-dev libfreetype6 libbz2-dev libcairo2-dev \ |
| 19 | + libenchant1c2a libevent-dev libffi-dev libfreetype6-dev \ |
| 20 | + libgraphviz-dev libjpeg-dev libjpeg8-dev liblcms2-dev libreadline-dev \ |
| 21 | + libsqlite3-dev libtiff5-dev libwebp-dev pandoc pkg-config zlib1g-dev |
| 22 | + |
| 23 | +# LaTeX -- split to reduce image layer size |
| 24 | +RUN apt-get -y install texlive-fonts-extra |
| 25 | +RUN apt-get -y install texlive-latex-extra-doc texlive-publishers-doc \ |
| 26 | + texlive-pictures-doc |
| 27 | +RUN apt-get -y install texlive-lang-english texlive-lang-japanese |
| 28 | +RUN apt-get -y install texlive-full |
| 29 | +RUN apt-get -y install \ |
| 30 | + texlive-fonts-recommended latex-cjk-chinese-arphic-bkai00mp \ |
| 31 | + latex-cjk-chinese-arphic-gbsn00lp latex-cjk-chinese-arphic-gkai00mp |
| 32 | + |
| 33 | +# Install Python tools/libs |
| 34 | +RUN apt-get -y install python-pip && pip install -U virtualenv auxlib |
| 35 | + |
| 36 | +# Install Conda |
| 37 | +RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh && \ |
| 38 | + bash Miniconda2-latest-Linux-x86_64.sh -b -p /usr/local/miniconda/ && \ |
| 39 | + ln -s /usr/local/miniconda/bin/conda /usr/local/bin/conda |
38 | 40 |
|
39 | 41 | # UID and GID from readthedocs/user
|
40 | 42 | RUN groupadd --gid 205 docs
|
41 | 43 | RUN useradd -m --uid 1005 --gid 205 docs
|
42 | 44 |
|
43 | 45 | USER docs
|
44 | 46 |
|
| 47 | +# Install pyenv |
| 48 | +RUN git clone --depth 1 https://github.com/yyuu/pyenv.git ~docs/.pyenv |
| 49 | +ENV PYENV_ROOT /home/docs/.pyenv |
| 50 | +ENV PATH /home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin |
| 51 | + |
| 52 | +# Install supported Python versions |
| 53 | +RUN pyenv install 2.7.13 && \ |
| 54 | + pyenv install 3.6.0 && \ |
| 55 | + pyenv install 3.5.2 && \ |
| 56 | + pyenv install 3.4.5 && \ |
| 57 | + pyenv install 3.3.6 && \ |
| 58 | + pyenv global 2.7.13 3.6.0 3.5.2 3.4.5 3.3.6 |
| 59 | + |
| 60 | +WORKDIR /tmp |
| 61 | + |
| 62 | +RUN pyenv local 2.7.13 && \ |
| 63 | + pyenv exec pip install -U pip && \ |
| 64 | + pyenv exec pip install --only-binary numpy,scipy numpy scipy && \ |
| 65 | + pyenv exec pip install pandas matplotlib virtualenv |
| 66 | + |
| 67 | +RUN pyenv local 3.6.0 && \ |
| 68 | + pyenv exec pip install -U pip && \ |
| 69 | + pyenv exec pip install --only-binary numpy,scipy numpy scipy && \ |
| 70 | + pyenv exec pip install pandas matplotlib virtualenv |
| 71 | + |
| 72 | +RUN pyenv local 3.5.2 && \ |
| 73 | + pyenv exec pip install -U pip && \ |
| 74 | + pyenv exec pip install --only-binary numpy,scipy numpy scipy && \ |
| 75 | + pyenv exec pip install pandas matplotlib virtualenv |
| 76 | + |
| 77 | +RUN pyenv local 3.4.5 && \ |
| 78 | + pyenv exec pip install -U pip && \ |
| 79 | + pyenv exec pip install --only-binary numpy,scipy numpy scipy && \ |
| 80 | + pyenv exec pip install pandas matplotlib virtualenv |
| 81 | + |
| 82 | +RUN pyenv local 3.3.6 && \ |
| 83 | + pyenv exec pip install -U pip && \ |
| 84 | + pyenv exec pip install --only-binary numpy,scipy numpy scipy && \ |
| 85 | + pyenv exec pip install "pandas<0.18" "matplotlib<1.5" virtualenv && \ |
| 86 | + pyenv local --unset |
| 87 | + |
| 88 | +WORKDIR / |
| 89 | + |
45 | 90 | CMD ["/bin/bash"]
|
0 commit comments