From 195213c43e66d7c97be10f277c1053620e78749d Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Tue, 19 Apr 2016 12:29:53 -0700 Subject: [PATCH] Explicitly empty ~/.cache This shaves off ~1.1MB off the container builds. We do --no-cache-dir on `pip install`, but turns out, this isn't enough. Stuff from within `get-pip.py` ends up leveraging the http cache as well, so we should just nuke it entirely. --- 2.7/Dockerfile | 2 +- 2.7/alpine/Dockerfile | 2 +- 2.7/slim/Dockerfile | 2 +- 2.7/wheezy/Dockerfile | 2 +- 3.3/Dockerfile | 2 +- 3.3/alpine/Dockerfile | 2 +- 3.3/slim/Dockerfile | 2 +- 3.3/wheezy/Dockerfile | 2 +- 3.4/Dockerfile | 2 +- 3.4/alpine/Dockerfile | 2 +- 3.4/slim/Dockerfile | 2 +- 3.4/wheezy/Dockerfile | 2 +- 3.5/Dockerfile | 2 +- 3.5/alpine/Dockerfile | 2 +- 3.5/slim/Dockerfile | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/2.7/Dockerfile b/2.7/Dockerfile index e0d6932e7..bfc0e691b 100644 --- a/2.7/Dockerfile +++ b/2.7/Dockerfile @@ -37,7 +37,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/2.7/alpine/Dockerfile b/2.7/alpine/Dockerfile index b889235f7..b18c27ba9 100644 --- a/2.7/alpine/Dockerfile +++ b/2.7/alpine/Dockerfile @@ -56,6 +56,6 @@ RUN set -ex \ )" \ && apk add --virtual .python-rundeps $runDeps \ && apk del .build-deps .fetch-deps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache CMD ["python2"] diff --git a/2.7/slim/Dockerfile b/2.7/slim/Dockerfile index c60d571f3..e4fe648b9 100644 --- a/2.7/slim/Dockerfile +++ b/2.7/slim/Dockerfile @@ -58,6 +58,6 @@ RUN set -ex \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache CMD ["python2"] diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile index 2c4823920..a69306d19 100644 --- a/2.7/wheezy/Dockerfile +++ b/2.7/wheezy/Dockerfile @@ -37,7 +37,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/3.3/Dockerfile b/3.3/Dockerfile index 69a446688..13451a7a5 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -37,7 +37,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.3/alpine/Dockerfile b/3.3/alpine/Dockerfile index a03b15f3d..f4b0226bc 100644 --- a/3.3/alpine/Dockerfile +++ b/3.3/alpine/Dockerfile @@ -56,7 +56,7 @@ RUN set -ex \ )" \ && apk add --virtual .python-rundeps $runDeps \ && apk del .build-deps .fetch-deps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.3/slim/Dockerfile b/3.3/slim/Dockerfile index 0bcd6cd18..12e5d1dde 100644 --- a/3.3/slim/Dockerfile +++ b/3.3/slim/Dockerfile @@ -58,7 +58,7 @@ RUN set -ex \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.3/wheezy/Dockerfile b/3.3/wheezy/Dockerfile index 43177e609..195d6a5d7 100644 --- a/3.3/wheezy/Dockerfile +++ b/3.3/wheezy/Dockerfile @@ -37,7 +37,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 040aea56b..706c6f055 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -36,7 +36,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/alpine/Dockerfile b/3.4/alpine/Dockerfile index e7eb0a571..51ec7c46e 100644 --- a/3.4/alpine/Dockerfile +++ b/3.4/alpine/Dockerfile @@ -56,7 +56,7 @@ RUN set -ex \ )" \ && apk add --virtual .python-rundeps $runDeps \ && apk del .build-deps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/slim/Dockerfile b/3.4/slim/Dockerfile index 9b700461b..b8863b3f1 100644 --- a/3.4/slim/Dockerfile +++ b/3.4/slim/Dockerfile @@ -57,7 +57,7 @@ RUN set -ex \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index e92fef69e..f8d2e77ed 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -36,7 +36,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.5/Dockerfile b/3.5/Dockerfile index 5879a9764..33dd20460 100644 --- a/3.5/Dockerfile +++ b/3.5/Dockerfile @@ -36,7 +36,7 @@ RUN set -ex \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.5/alpine/Dockerfile b/3.5/alpine/Dockerfile index 2f50b9628..34182187c 100644 --- a/3.5/alpine/Dockerfile +++ b/3.5/alpine/Dockerfile @@ -56,7 +56,7 @@ RUN set -ex \ )" \ && apk add --virtual .python-rundeps $runDeps \ && apk del .build-deps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.5/slim/Dockerfile b/3.5/slim/Dockerfile index 671265a52..939e435c6 100644 --- a/3.5/slim/Dockerfile +++ b/3.5/slim/Dockerfile @@ -57,7 +57,7 @@ RUN set -ex \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \