Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
use --no-cache-dir flag to pip in dockerfiles to save space
Browse files Browse the repository at this point in the history
using "--no-cache-dir" flag in pip install ,make sure downloaded packages
by pip don't cached on system . This is a best practice which make sure
to fetch from repo instead of using local cached one . Further , in case
of Docker Containers , by restricting caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Signed-off-by: Pratik raj <[email protected]>
  • Loading branch information
Rajpratik71 committed Dec 11, 2020
1 parent 4d4ebe5 commit 109953c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions applications/openvino/benchmark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ RUN $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh
RUN mkdir $INSTALL_DIR/deployment_tools/inference_engine/samples/cpp/build
WORKDIR $INSTALL_DIR/deployment_tools/inference_engine/samples/cpp/build
RUN /bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && cmake .. && make -j1"
RUN pip3 install networkx==2.3
RUN pip3 install --no-cache-dir networkx==2.3

WORKDIR /opt/intel/openvino/deployment_tools/demo
RUN /bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && ./demo_squeezenet_download_convert_run.sh"

#Download OpenVINO pre-trained models

RUN pip3 install pyyaml requests
RUN pip3 install --no-cache-dir pyyaml requests
WORKDIR /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader
RUN ./downloader.py --name face-detection-retail-0004
RUN ./downloader.py --name squeezenet1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN yum install -y python36-pip

# needed by openedge when build
RUN yum install -y zip unzip tcpdump
RUN pip3 install grpcio protobuf pyyaml
RUN pip3 install --no-cache-dir grpcio protobuf pyyaml


#RUN yum install -y wget python iputils-ping python-pip openssh-server expect iperf3 net-tools openssh-clients psmisc
Expand All @@ -21,7 +21,7 @@ RUN yum install -y make git
WORKDIR /root/

# install python pip and grpcio
#RUN pip install protobuf grpcio
#RUN pip install --no-cache-dir protobuf grpcio

# install golang
RUN wget https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz
Expand Down

0 comments on commit 109953c

Please sign in to comment.