Skip to content

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

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
75 changes: 4 additions & 71 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
# Read the Docs - Environment base
FROM ubuntu:16.04
FROM readthedocs/build:base
MAINTAINER Read the Docs <[email protected]>
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

# 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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be a problem since we are already as a docs user from the base image :)

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
libsqlite3-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 +24,4 @@ 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"]
83 changes: 83 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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 <[email protected]>
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 software-properties-common
RUN apt-get -y install python-setuptools python3-setuptools python-dev python3-dev

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

# from readthedocs.build
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

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"]