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

Docker purge unneeded files #589

Merged
merged 6 commits into from
Jan 21, 2016
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py && \
rm get-pip.py && \
pip2 --no-cache-dir install requests[security] && \
pip3 --no-cache-dir install requests[security]
pip3 --no-cache-dir install requests[security] && \
rm get-pip.py && \
rm -rf /root/.cache

# Install some dependencies.
RUN pip2 --no-cache-dir install ipykernel && \
pip3 --no-cache-dir install ipykernel && \
\
python2 -m ipykernel.kernelspec && \
python3 -m ipykernel.kernelspec
python3 -m ipykernel.kernelspec && \
rm -rf /root/.cache

# Move notebook contents into place.
ADD . /usr/src/jupyter-notebook
Expand All @@ -78,7 +81,13 @@ RUN BUILD_DEPS="nodejs-legacy npm" && \
\
pip3 install --no-cache-dir --pre -e /usr/src/jupyter-notebook && \
\
npm cache clean && \
apt-get clean && \
rm -rf /root/.npm && \
rm -rf /root/.cache && \
rm -rf /root/.config && \
rm -rf /root/.local && \
rm -rf /root/tmp && \
rm -rf /var/lib/apt/lists/* && \
apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS
Expand All @@ -90,7 +99,8 @@ RUN pip2 install --no-cache-dir mock nose requests testpath && \
iptest2 && iptest3 && \
\
pip2 uninstall -y funcsigs mock nose pbr requests six testpath && \
pip3 uninstall -y nose requests testpath
pip3 uninstall -y nose requests testpath && \
rm -rf /root/.cache

# Add a notebook profile.
RUN mkdir -p -m 700 /root/.jupyter/ && \
Expand Down