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

Commit 109953c

Browse files
committed
use --no-cache-dir flag to pip in dockerfiles to save space
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]>
1 parent 4d4ebe5 commit 109953c

File tree

2 files changed

+4
-4
lines changed
  • applications/openvino/benchmark
  • iot-gateway/baidu-openedge/scripts/ansible/examples/setup_baidu_openedge/composefile

2 files changed

+4
-4
lines changed

applications/openvino/benchmark/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ RUN $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh
4040
RUN mkdir $INSTALL_DIR/deployment_tools/inference_engine/samples/cpp/build
4141
WORKDIR $INSTALL_DIR/deployment_tools/inference_engine/samples/cpp/build
4242
RUN /bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && cmake .. && make -j1"
43-
RUN pip3 install networkx==2.3
43+
RUN pip3 install --no-cache-dir networkx==2.3
4444

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

4848
#Download OpenVINO pre-trained models
4949

50-
RUN pip3 install pyyaml requests
50+
RUN pip3 install --no-cache-dir pyyaml requests
5151
WORKDIR /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader
5252
RUN ./downloader.py --name face-detection-retail-0004
5353
RUN ./downloader.py --name squeezenet1.1

iot-gateway/baidu-openedge/scripts/ansible/examples/setup_baidu_openedge/composefile/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN yum install -y python36-pip
1111

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

1616

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

2323
# install python pip and grpcio
24-
#RUN pip install protobuf grpcio
24+
#RUN pip install --no-cache-dir protobuf grpcio
2525

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

0 commit comments

Comments
 (0)