Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is just an initial concept to break apart our Docker files. #30

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 5 additions & 68 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# Read the Docs - Environment base
FROM ubuntu:16.04
FROM readthedocs/build:base
MAINTAINER Read the Docs <support@readthedocs.com>
LABEL version="latest"

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

# System dependencies
RUN apt-get -y update
RUN apt-get -y install vim software-properties-common
USER root

# Install requirements
RUN apt-get -y install \
bzr subversion git-core mercurial libpq-dev libxml2-dev libxslt-dev \
RUN apt-get -y install libpq-dev libxml2-dev libxslt-dev \
libxslt1-dev build-essential postgresql-client libmysqlclient-dev curl \
doxygen g++ graphviz-dev libfreetype6 libbz2-dev libcairo2-dev \
g++ libfreetype6 libbz2-dev libcairo2-dev \
libenchant1c2a libevent-dev libffi-dev libfreetype6-dev \
libgraphviz-dev libjpeg-dev libjpeg8-dev liblcms2-dev libreadline-dev \
libsqlite3-dev libtiff5-dev libwebp-dev pandoc pkg-config zlib1g-dev
libtiff5-dev libwebp-dev pkg-config zlib1g-dev

# LaTeX -- split to reduce image layer size
RUN apt-get -y install texlive-fonts-extra
Expand All @@ -33,62 +26,6 @@ RUN apt-get -y install \
# Install plantuml
RUN apt-get -y install plantuml

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

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

USER docs
WORKDIR /home/docs

# Install Conda
RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-4.3.11-Linux-x86_64.sh
RUN bash Miniconda2-4.3.11-Linux-x86_64.sh -b -p /home/docs/.conda/
env PATH $PATH:/home/docs/.conda/bin

# Install pyenv
RUN git clone --depth 1 https://github.com/yyuu/pyenv.git ~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 2.7.13 && \
pyenv install 3.6.0 && \
pyenv install 3.5.2 && \
pyenv install 3.4.5 && \
pyenv install 3.3.6 && \
pyenv global 2.7.13 3.6.0 3.5.2 3.4.5 3.3.6

WORKDIR /tmp

RUN pyenv local 2.7.13 && \
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 3.6.0 && \
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 3.5.2 && \
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 3.4.5 && \
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 3.3.6 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install "pandas<0.18" "matplotlib<1.5" virtualenv && \
pyenv local --unset

WORKDIR /

CMD ["/bin/bash"]
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ To use these images, you can pull from Docker Hub:

You can also compile these images manually:

docker build -t readthedocs/build:base base
docker build -t readthedocs/build:latest .

Push to Docker Hub
Expand Down
89 changes: 89 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Read the Docs - Sphinx Only Image
#
# This image only has a base sphinx and python environment.
# It can't create PDF's and doesn't have special C libraries.

FROM ubuntu:16.04
MAINTAINER Read the Docs <support@readthedocs.com>
LABEL version="base"

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

# System dependencies
RUN apt-get -y update
RUN apt-get -y install vim curl

# Version control and basic building utilies
RUN apt-get -y install bzr subversion git-core mercurial

# Basic conversion and sphinx extension requirements
RUN apt-get -y install graphviz graphviz-dev pandoc doxygen

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

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

# Try and fix openssl build
RUN apt-get -y install libssl-dev libsqlite3-dev

# Fix matplotlib
RUN apt-get -y install pkg-config libfreetype6 libfreetype6-dev

USER docs
WORKDIR /home/docs

# Install Conda
RUN curl -O https://repo.continuum.io/miniconda/Miniconda2-4.3.11-Linux-x86_64.sh
RUN bash Miniconda2-4.3.11-Linux-x86_64.sh -b -p /home/docs/.conda/
env PATH $PATH:/home/docs/.conda/bin

# Install pyenv
RUN git clone --depth 1 https://github.com/yyuu/pyenv.git ~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 2.7.13 && \
pyenv install 3.6.0 && \
pyenv install 3.5.2 && \
pyenv install 3.4.5 && \
pyenv install 3.3.6 && \
pyenv global 2.7.13 3.6.0 3.5.2 3.4.5 3.3.6

WORKDIR /tmp

RUN pyenv local 2.7.13 && \
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 3.6.0 && \
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 3.5.2 && \
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 3.4.5 && \
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 3.3.6 && \
pyenv exec pip install -U pip && \
pyenv exec pip install --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install "pandas<0.18" "matplotlib<1.5" virtualenv && \
pyenv local --unset

WORKDIR /

CMD ["/bin/bash"]