Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing 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: OPTFRA-774
Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
Change-Id: I40d9eb94ecea623a9ed54b50b1786b154788a17b
ADD ./ /opt/aafsim
# Install any needed packages specified in requirements.txt
-RUN pip install web.py
-RUN pip install oslo.log
+RUN pip install --no-cache-dir web.py
+RUN pip install --no-cache-dir oslo.log
# Make port 80 available to the world outside this container
EXPOSE 8100
ADD ./ /opt/aaisim
# Install any needed packages specified in requirements.txt
-RUN pip install web.py
+RUN pip install --no-cache-dir web.py
# Make port 80 available to the world outside this container
EXPOSE 8081
ADD ./ /opt/multicloudsim
# Install any needed packages specified in requirements.txt
-RUN pip install web.py
+RUN pip install --no-cache-dir web.py
# Make port 80 available to the world outside this container
EXPOSE 8082
apk add bash vim && \
apk add nginx && \
apk add py2-pip libpq python-dev && \
- pip install --upgrade pip && \
+ pip install --no-cache-dir --upgrade pip && \
apk add --virtual build-dependencies build-base linux-headers pcre-dev libffi-dev libxslt-dev libressl-dev && \
- pip install uwsgi
+ pip install --no-cache-dir uwsgi
# Get, Install, cleanup and setup
COPY onap-has-tm/optf-has-conductor-${MVN_ARTIFACT_VERSION}.zip /tmp/optf-has.zip
#PKG-INFO file must also exists in the conductor folder (i.e. besides and inside the of_has.egg-info folder). The zip file for distro above is missing it
RUN cp /opt/has/conductor/of_has.egg-info/PKG-INFO /opt/has/conductor
-RUN pip install -e /opt/has/conductor
+RUN pip install --no-cache-dir -e /opt/has/conductor
COPY app.wsgi /etc/nginx/conductor.wsgi
COPY api_paste.ini /usr/local/etc/conductor/api_paste.ini
basepython=python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-install_command = pip install -U {opts} {packages}
+install_command = pip install --no-cache-dir -U {opts} {packages}
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=conductor/tests/unit
.. code:: bash
- $ pip install of-has
+ $ pip install --no-cache-dir of-has
-To upgrade or downgrade, simply re-run ``pip install`` using the
+To upgrade or downgrade, simply re-run ``pip install --no-cache-dir`` using the
appropriate ``pip`` command line options.
**NOTE**: Be sure proxy settings are in place if they're required to
Receiving objects: 100% (2291/2291), 477.59 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1422/1422), done.
$ cd conductor
- $ pip install .
+ $ pip install --no-cache-dir .
The latest source can be pulled from ONAP at any time and reinstalled:
.. code:: bash
$ git pull
- $ pip install .
+ $ pip install --no-cache-dir .
Verifying Installation
~~~~~~~~~~~~~~~~~~~~~~
rm -rf ./venv-tox ./.tox
virtualenv ./venv-tox
source ./venv-tox/bin/activate
- pip install --upgrade pip
- pip install --upgrade tox argparse
+ pip install --no-cache-dir --upgrade pip
+ pip install --no-cache-dir --upgrade tox argparse
pip freeze
tox -e cover
deactivate