From ce1c12247f79468b9d82e0c14d1d0f3003fb4ee8 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Mon, 26 Feb 2018 19:58:31 -0500 Subject: [PATCH] Cleanup after Miniconda install in Docker build To cutdown on the Docker image size, handle the install of Miniconda and subsequent clean up in the same `RUN` step. The cleanup includes the removal the install script, cached conda packages, and conda package tarballs. This should cutdown the size of this Docker layer and save memory on CI. --- Dockerfile-master | 6 ++++-- Dockerfile-slave | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile-master b/Dockerfile-master index 6c1d5ee..3ccebfb 100644 --- a/Dockerfile-master +++ b/Dockerfile-master @@ -4,8 +4,10 @@ ENV LANG C.UTF-8 RUN apt-get update && apt-get install curl bzip2 git gcc -y --fix-missing -RUN curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -RUN bash miniconda.sh -f -b -p /opt/anaconda +RUN curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + bash miniconda.sh -f -b -p /opt/anaconda && \ + /opt/anaconda/bin/conda clean -tipy && \ + rm -f miniconda.sh ENV PATH /opt/anaconda/bin:$PATH RUN conda install -n root conda=4.4.11 && conda clean -tipy RUN conda install -c conda-forge dask distributed nomkl pytest mock ipython pip psutil && conda clean -tipy diff --git a/Dockerfile-slave b/Dockerfile-slave index edd7521..d417858 100644 --- a/Dockerfile-slave +++ b/Dockerfile-slave @@ -4,7 +4,10 @@ ENV LANG C.UTF-8 RUN apt-get update && apt-get install curl bzip2 git gcc -y --fix-missing -RUN curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh +RUN curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + bash miniconda.sh -f -b -p /opt/anaconda && \ + /opt/anaconda/bin/conda clean -tipy && \ + rm -f miniconda.sh RUN bash miniconda.sh -f -b -p /opt/anaconda ENV PATH /opt/anaconda/bin:$PATH RUN conda install -n root conda=4.4.11 && conda clean -tipy