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

3.x shrink image #8856

Closed
wants to merge 9 commits into from
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.git*
.mailmap
.travis.yml
IPython/html/static/components/.git
IPython/html/static/components/.gitignore
Copy link
Member

Choose a reason for hiding this comment

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

These are certainly a good idea to dockerignore.

99 changes: 47 additions & 52 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,71 +1,66 @@
# Installs IPython from the current branch
# Another Docker container should build from this one to get services like the notebook
# Other Docker images should build from this one to get services like the notebook
Copy link
Member

Choose a reason for hiding this comment

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

This comment is way out of date now that jupyter/notebook provides it.


FROM ubuntu:14.04

MAINTAINER IPython Project <ipython-dev@scipy.org>

ENV DEBIAN_FRONTEND noninteractive

# Not essential, but wise to set the lang
# Note: Users with other languages should set this in their derivative image
RUN apt-get update && apt-get install -y language-pack-en
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN locale-gen en_US.UTF-8
RUN dpkg-reconfigure locales

# Python binary dependencies, developer tools
RUN apt-get update && apt-get install -y -q \
build-essential \
curl \
make \
gcc \
zlib1g-dev \
git \
python \
python-dev \
python3-dev \
python-sphinx \
python3-sphinx \
libzmq3-dev \
sqlite3 \
libsqlite3-dev \
pandoc \
libcurl4-openssl-dev \
nodejs \
nodejs-legacy \
npm

# Install the recent pip release
RUN curl -O https://bootstrap.pypa.io/get-pip.py \
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
language-pack-en \
libcurl4-openssl-dev \
libsqlite3-dev \
libzmq3-dev \
pandoc \
python \
python-dev \
python3-dev \
sqlite3 \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* \
\
`# Install the recent pip release` \
&& curl -O https://bootstrap.pypa.io/get-pip.py \
&& python2 get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py

# In order to build from source, need less
RUN npm install -g 'less@<3.0'

RUN pip install invoke

RUN mkdir -p /srv/
WORKDIR /srv/
ADD . /srv/ipython
WORKDIR /srv/ipython/
RUN chmod -R +rX /srv/ipython

# .[all] only works with -e, so use file://path#egg
# Can't use -e because ipython2 and ipython3 will clobber each other
RUN pip2 install file:///srv/ipython#egg=ipython[all]
RUN pip3 install file:///srv/ipython#egg=ipython[all]

# install kernels
RUN python2 -m IPython kernelspec install-self
RUN python3 -m IPython kernelspec install-self
# Install IPython
ADD . /ipython
RUN chmod -R +rX /ipython \
\
`# Install build dependencies` \
&& BUILD_DEPS="nodejs nodejs-legacy npm" \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends $BUILD_DEPS \
&& npm install -g 'less@<3.0' \
\
`# .[all] only works with -e, so use file://path#egg` \
`# Cant use -e because ipython2 and ipython3 will clobber each other` \
&& pip2 install --no-cache-dir file:///ipython#egg=ipython[all] \
&& pip3 install --no-cache-dir file:///ipython#egg=ipython[all] \
\
`# Uninstall build dependencies` \
&& npm remove -g less \
&& npm cache clean \
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/* \
\
`# install kernels` \
&& python2 -m IPython kernelspec install-self \
&& python3 -m IPython kernelspec install-self \
&& iptest2 && iptest3

WORKDIR /tmp/

RUN iptest2
RUN iptest3