From be9133eea5b846c953b30c53a885e1008516f85f Mon Sep 17 00:00:00 2001 From: Marc Belmont <45101+marcbelmont@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:28:08 +0200 Subject: [PATCH] Add pip3 --no-cache-dir and apt clean to reduce image size --- Dockerfile.tensorflow | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Dockerfile.tensorflow b/Dockerfile.tensorflow index 63ff25005..fdda7cc95 100644 --- a/Dockerfile.tensorflow +++ b/Dockerfile.tensorflow @@ -37,7 +37,7 @@ RUN printenv # RUN apt-get update && \ apt-get install -y --no-install-recommends \ - python3-pip \ + python3-pip \ python3-dev \ gfortran \ build-essential \ @@ -49,13 +49,13 @@ RUN apt-get update && \ zlib1g-dev \ zip \ libjpeg8-dev \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && apt-get clean -RUN pip3 install setuptools Cython wheel -RUN pip3 install numpy --verbose -RUN pip3 install h5py==2.10.0 --verbose -RUN pip3 install future==0.17.1 mock==3.0.5 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11 --verbose +RUN pip3 install --no-cache-dir --verbose \ + setuptools Cython wheel numpy h5py==2.10.0 future==0.17.1 mock==3.0.5 keras_preprocessing==1.0.5 \ + keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11 # @@ -67,7 +67,7 @@ ARG TENSORFLOW_URL=https://nvidia.box.com/shared/static/rummpy6q1km1wivomalpkwt2 ARG TENSORFLOW_WHL=tensorflow-1.15.2+nv-cp36-cp36m-linux_aarch64.whl RUN wget --quiet --show-progress --progress=bar:force:noscroll --no-check-certificate ${TENSORFLOW_URL} -O ${TENSORFLOW_WHL} && \ - pip3 install ${TENSORFLOW_WHL} --verbose && \ + pip3 install --no-cache-dir --verbose ${TENSORFLOW_WHL} && \ rm ${TENSORFLOW_WHL} @@ -78,7 +78,4 @@ ENV PATH="/usr/local/cuda/bin:${PATH}" ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}" RUN echo "$PATH" && echo "$LD_LIBRARY_PATH" -RUN pip3 install pycuda --verbose - - - +RUN pip3 install --no-cache-dir --verbose pycuda