From 533c0d77decb5c86f5f06e4a8061a9042b7ce6ce Mon Sep 17 00:00:00 2001 From: Pratik raj Date: Wed, 30 Dec 2020 10:41:52 +0530 Subject: [docker] 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 Issue-ID: MULTICLOUD-1279 Signed-off-by: Pratik Raj Change-Id: If01ac9167727423f65788bdf6abfd8ee0e1546cc --- lenovo/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lenovo') diff --git a/lenovo/docker/Dockerfile b/lenovo/docker/Dockerfile index c4489ce7..8d0a5e8e 100644 --- a/lenovo/docker/Dockerfile +++ b/lenovo/docker/Dockerfile @@ -41,7 +41,7 @@ RUN apt-get update && \ unzip -q -o -B multicloud-openstack-lenovo.zip && \ chmod +x /opt/lenovo/*.sh &&\ rm -f multicloud-openstack-lenovo.zip &&\ - pip install -r /opt/lenovo/requirements.txt &&\ + pip install --no-cache-dir -r /opt/lenovo/requirements.txt &&\ apt-get --purge remove -y wget unzip gcc libssl-dev && \ apt-get -y autoremove && \ mkdir -p /var/log/onap/multicloud/openstack/lenovo && \ -- cgit 1.2.3-korg