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
unzip -q -o -B multicloud-openstack-fcaps.zip && \
chmod +x /opt/fcaps/*.sh && \
rm -f multicloud-openstack-fcaps.zip && \
- pip3 install -r /opt/fcaps/requirements.txt && \
- pip3 install -r /opt/fcaps/uwsgi-requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/fcaps/requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/fcaps/uwsgi-requirements.txt && \
apk del wget unzip gcc make libc-dev libffi-dev openssl-dev pcre-dev && \
mkdir -p /var/log/onap/multicloud/fcaps && \
chown onap:onap /var/log/onap -R && \
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 && \
unzip -q -o -B multicloud-openstack-newton.zip && \
chmod +x /opt/newton/*.sh && \
rm -f multicloud-openstack-newton.zip && \
- pip install -r /opt/newton/requirements.txt
+ pip install --no-cache-dir -r /opt/newton/requirements.txt
WORKDIR /opt/newton
CMD /bin/sh -c /opt/newton/run.sh
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 && \
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
cd /opt/ && \
unzip -q -o -B /opt/multicloud-openstack-pike.zip -d /opt/ && \
rm -f /opt/multicloud-openstack-pike.zip && \
- pip3 install -r /opt/pike/requirements.txt && \
- pip3 install -r /opt/pike/uwsgi-requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/pike/requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/pike/uwsgi-requirements.txt && \
apt-get --purge remove -y wget unzip gcc libssl-dev && \
mkdir -p /var/log/onap/multicloud/openstack/pike && \
chown onap:onap /var/log/onap -R && \
cd /opt/ && \
unzip -q -o -B /opt/multicloud-openstack-pike.zip -d /opt/ && \
rm -f /opt/multicloud-openstack-pike.zip && \
- pip3 install -r /opt/pike/requirements.txt && \
- pip3 install -r /opt/pike/uwsgi-requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/pike/requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/pike/uwsgi-requirements.txt && \
apt-get --purge remove -y wget unzip gcc libssl-dev && \
mkdir -p /var/log/onap/multicloud/openstack/pike && \
chown onap:onap /var/log/onap -R && \
cd /opt/ && \
unzip -q -o -B /opt/multicloud-openstack-starlingx.zip -d /opt/ && \
rm -f /opt/multicloud-openstack-starlingx.zip && \
- pip3 install -r /opt/starlingx/requirements.txt && \
- pip3 install -r /opt/starlingx/uwsgi-requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/starlingx/requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/starlingx/uwsgi-requirements.txt && \
apk del wget unzip gcc make libc-dev libffi-dev openssl-dev pcre-dev && \
mkdir -p /var/log/onap/multicloud/openstack/starlingx && \
chown onap:onap /var/log/onap -R && \
unzip -q -o -B multicloud-openstack-windriver.zip && \
chmod +x /opt/windriver/*.sh && \
rm -f multicloud-openstack-windriver.zip && \
- pip3 install -r /opt/windriver/requirements.txt && \
- pip3 install -r /opt/windriver/uwsgi-requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/windriver/requirements.txt && \
+ pip3 install --no-cache-dir -r /opt/windriver/uwsgi-requirements.txt && \
apk del wget unzip gcc make libc-dev libffi-dev openssl-dev pcre-dev && \
mkdir -p /var/log/onap/multicloud/openstack/windriver && \
chown onap:onap /var/log/onap -R && \