Skip to content

Commit

Permalink
Merge pull request #589 from jakirkham/docker_purge_unneed_files
Browse files Browse the repository at this point in the history
Docker purge unneeded files
  • Loading branch information
minrk committed Jan 21, 2016
2 parents 7e4f72e + 2902db6 commit 84768ed
Showing 1 changed file with 13 additions and 3 deletions.
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

0 comments on commit 84768ed

Please sign in to comment.