Save space in Alpine containers 21/37621/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Mon, 17 Jul 2017 10:31:06 +0000 (12:31 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 17 Jul 2017 11:02:08 +0000 (13:02 +0200)
It decreases the size of Functest core and smoke containers by 20%.

Change-Id: Id75117b1404e3cce004ef51c61040cdb7ade6976
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/core/Dockerfile
docker/smoke/Dockerfile

index 574de9b..ebd76a2 100644 (file)
@@ -12,7 +12,7 @@ RUN apk --no-cache add --update \
     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
         sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
         > upper-constraints.txt && \
-    pip install --src /src -cupper-constraints.txt \
+    pip install --no-cache-dir --src /src -cupper-constraints.txt \
         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
         git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest && \
     rm upper-constraints.txt && \
index 15ab702..22ff2eb 100644 (file)
@@ -7,13 +7,13 @@ COPY thirdparty-requirements.txt thirdparty-requirements.txt
 RUN apk --no-cache add --virtual .build-deps --update \
         python-dev build-base linux-headers libffi-dev \
         openssl-dev libjpeg-turbo-dev git && \
-    pip install --src /src \
+    pip install --no-cache-dir --src /src \
         -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
         -rthirdparty-requirements.txt && \
     ln -s /src/tempest /src/refstack-client/.tempest && \
     virtualenv --system-site-packages /src/tempest/.venv && \
-    rm thirdparty-requirements.txt && \
+    rm -r thirdparty-requirements.txt /src/refstack-client/.git && \
     apk del .build-deps
 COPY testcases.yaml /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
 CMD ["bash","-c","prepare_env start && run_tests -t all"]