From 9056707a18fca939d20efb673a1c56feb378a068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Sat, 6 Mar 2021 20:33:53 +1300 Subject: [PATCH] Shrink the docker image size --- docker/Dockerfile.gpu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.gpu b/docker/Dockerfile.gpu index a1e014e..1e9067c 100644 --- a/docker/Dockerfile.gpu +++ b/docker/Dockerfile.gpu @@ -66,7 +66,9 @@ RUN apt-get update -q && apt-get install -q -y --no-install-recommends \ libzmq3-dev \ pkg-config \ software-properties-common \ - unzip + unzip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* # Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ @@ -126,10 +128,12 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION} # Now we're ready to create our conda environment COPY environment.yml /tmp/ -RUN conda update -y -n base conda \ - && echo ' - pyvirtualdisplay' >> /tmp/environment.yml \ +RUN echo ' - pyvirtualdisplay' >> /tmp/environment.yml \ && conda env create -f /tmp/environment.yml \ - && conda clean -y -t \ + && conda clean -afy \ + && find /opt/conda/ -follow -type f -name '*.a' -delete \ + && find /opt/conda/ -follow -type f -name '*.pyc' -delete \ + && find /opt/conda/ -follow -type f -name '*.js.map' -delete \ && rm /tmp/environment.yml ARG username