From 10cd9b44bbbb5258181ee62aedd2e5b62318c764 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 8 Mar 2017 12:50:48 -0800 Subject: [PATCH] This is just an initial concept to break apart our Docker files. This addresses #29, and gives us a `base` image that just has the Python environment, VCS tools, and a couple other standard utilities. Then it has a `full` image that adds all of the PDF/C libraries/etc. This is where most of the time and bloat comes from, and isn't actually required for most testing, HTML builds, conda builds, and lots of other use cases. This would allow us to interate and test base builds faster, while keeping the environment the same in production. NOTE: I'm mostly looking for feedback on this PR, not specific nitpicking. --- base/Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ full/Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 base/Dockerfile create mode 100644 full/Dockerfile diff --git a/base/Dockerfile b/base/Dockerfile new file mode 100644 index 0000000..e1eeb6d --- /dev/null +++ b/base/Dockerfile @@ -0,0 +1,42 @@ +# 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 +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 python-setuptools \ + python3-setuptools python3 python3-pip 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 + +RUN easy_install3 pip +RUN easy_install pip +RUN pip3 install -U virtualenv auxlib +RUN pip2 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 + +# Install miniconda as docs user +WORKDIR /home/docs +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/miniconda2/ +env PATH $PATH:/home/docs/miniconda2/bin + +CMD ["/bin/bash"] diff --git a/full/Dockerfile b/full/Dockerfile new file mode 100644 index 0000000..2fdfea2 --- /dev/null +++ b/full/Dockerfile @@ -0,0 +1,21 @@ +# Read the Docs - Environment base +FROM readthedocs/base:latest +MAINTAINER Read the Docs +LABEL version="2.0" + +# from readthedocs.common +RUN apt-get -y install libpq-dev libxml2-dev libxslt-dev libxslt1-dev postgresql-client libmysqlclient-dev + +# from readthedocs.build +RUN apt-get -y install libfreetype6 g++ sqlite libevent-dev libffi-dev \ + libenchant1c2a curl texlive-full python-m2crypto python-matplotlib \ + python-numpy python-scipy python-pandas graphviz graphviz-dev \ + libgraphviz-dev pandoc doxygen latex-cjk-chinese-arphic-gbsn00lp \ + latex-cjk-chinese-arphic-gkai00mp latex-cjk-chinese-arphic-bsmi00lp \ + latex-cjk-chinese-arphic-bkai00mp python3 python3-dev python3-pip \ + python3-matplotlib python3-numpy python3-scipy python3-pandas \ + texlive-latex-extra texlive-fonts-recommended pkg-config libjpeg-dev \ + libfreetype6-dev libtiff5-dev libjpeg8-dev zlib1g-dev liblcms2-dev \ + libwebp-dev libcairo2-dev + +CMD ["/bin/bash"]