summaryrefslogtreecommitdiffstats
path: root/ocata
diff options
context:
space:
mode:
authorPratik raj <rajpratik71@gmail.com>2020-12-30 10:41:52 +0530
committerPratik raj <rajpratik71@gmail.com>2020-12-30 10:41:52 +0530
commit533c0d77decb5c86f5f06e4a8061a9042b7ce6ce (patch)
tree1485bd3f70694a82fa2a9d8e6d31fedc07a7b783 /ocata
parent37cc7b1bb226e2d2840b093290b4afb5aa78ec16 (diff)
[docker] use `--no-cache-dir` flag to `pip` in dockerfiles to save spacehonolulu
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 Issue-ID: MULTICLOUD-1279 Signed-off-by: Pratik Raj <rajpratik71@gmail.com> Change-Id: If01ac9167727423f65788bdf6abfd8ee0e1546cc
Diffstat (limited to 'ocata')
-rw-r--r--ocata/docker/Dockerfile2
-rw-r--r--ocata/vagrant/test/Dockerfile2
2 files changed, 2 insertions, 2 deletions
diff --git a/ocata/docker/Dockerfile b/ocata/docker/Dockerfile
index c4fa139a..ebf2d179 100644
--- a/ocata/docker/Dockerfile
+++ b/ocata/docker/Dockerfile
@@ -40,7 +40,7 @@ RUN apt-get update && \
wget -O /opt/multicloud-openstack-ocata.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=staging&g=org.onap.multicloud.openstack&a=multicloud-openstack-ocata&e=zip&v=1.4.0" && \
unzip -q -o -B /opt/multicloud-openstack-ocata.zip -d /opt/ && \
rm -f /opt/multicloud-openstack-ocata.zip && \
- pip install -r /opt/ocata/requirements.txt && \
+ pip install --no-cache-dir -r /opt/ocata/requirements.txt && \
apt-get --purge remove -y wget unzip gcc libssl-dev && \
apt-get -y autoremove && \
mkdir -p /var/log/onap/multicloud/openstack/ocata && \
diff --git a/ocata/vagrant/test/Dockerfile b/ocata/vagrant/test/Dockerfile
index 10e17cae..c3bfaafc 100644
--- a/ocata/vagrant/test/Dockerfile
+++ b/ocata/vagrant/test/Dockerfile
@@ -31,7 +31,7 @@ RUN apt-get update && \
unzip -q -o -B multicloud-openstack-ocata.zip && \
chmod +x /opt/ocata/*.sh && \
rm -f multicloud-openstack-ocata.zip && \
- pip install -r /opt/ocata/requirements.txt
+ pip install --no-cache-dir -r /opt/ocata/requirements.txt
ADD extsys.py /opt/ocata/lib/share/common/msapi/extsys.py