Skip to content

Commit 195213c

Browse files
committed
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.
1 parent e327311 commit 195213c

File tree

15 files changed

+15
-15
lines changed

15 files changed

+15
-15
lines changed

2.7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN set -ex \
3737
\( -type d -a -name test -o -name tests \) \
3838
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
3939
-exec rm -rf '{}' + \
40-
&& rm -rf /usr/src/python
40+
&& rm -rf /usr/src/python ~/.cache
4141

4242
# install "virtualenv", since the vast majority of users of this image will want it
4343
RUN pip install --no-cache-dir virtualenv

2.7/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ RUN set -ex \
5656
)" \
5757
&& apk add --virtual .python-rundeps $runDeps \
5858
&& apk del .build-deps .fetch-deps \
59-
&& rm -rf /usr/src/python
59+
&& rm -rf /usr/src/python ~/.cache
6060

6161
CMD ["python2"]

2.7/slim/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ RUN set -ex \
5858
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
5959
-exec rm -rf '{}' + \
6060
&& apt-get purge -y --auto-remove $buildDeps \
61-
&& rm -rf /usr/src/python
61+
&& rm -rf /usr/src/python ~/.cache
6262

6363
CMD ["python2"]

2.7/wheezy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN set -ex \
3737
\( -type d -a -name test -o -name tests \) \
3838
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
3939
-exec rm -rf '{}' + \
40-
&& rm -rf /usr/src/python
40+
&& rm -rf /usr/src/python ~/.cache
4141

4242
# install "virtualenv", since the vast majority of users of this image will want it
4343
RUN pip install --no-cache-dir virtualenv

3.3/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN set -ex \
3737
\( -type d -a -name test -o -name tests \) \
3838
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
3939
-exec rm -rf '{}' + \
40-
&& rm -rf /usr/src/python
40+
&& rm -rf /usr/src/python ~/.cache
4141

4242
# make some useful symlinks that are expected to exist
4343
RUN cd /usr/local/bin \

3.3/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ RUN set -ex \
5656
)" \
5757
&& apk add --virtual .python-rundeps $runDeps \
5858
&& apk del .build-deps .fetch-deps \
59-
&& rm -rf /usr/src/python
59+
&& rm -rf /usr/src/python ~/.cache
6060

6161
# make some useful symlinks that are expected to exist
6262
RUN cd /usr/local/bin \

3.3/slim/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUN set -ex \
5858
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
5959
-exec rm -rf '{}' + \
6060
&& apt-get purge -y --auto-remove $buildDeps \
61-
&& rm -rf /usr/src/python
61+
&& rm -rf /usr/src/python ~/.cache
6262

6363
# make some useful symlinks that are expected to exist
6464
RUN cd /usr/local/bin \

3.3/wheezy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ RUN set -ex \
3737
\( -type d -a -name test -o -name tests \) \
3838
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
3939
-exec rm -rf '{}' + \
40-
&& rm -rf /usr/src/python
40+
&& rm -rf /usr/src/python ~/.cache
4141

4242
# make some useful symlinks that are expected to exist
4343
RUN cd /usr/local/bin \

3.4/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN set -ex \
3636
\( -type d -a -name test -o -name tests \) \
3737
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
3838
-exec rm -rf '{}' + \
39-
&& rm -rf /usr/src/python
39+
&& rm -rf /usr/src/python ~/.cache
4040

4141
# make some useful symlinks that are expected to exist
4242
RUN cd /usr/local/bin \

3.4/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ RUN set -ex \
5656
)" \
5757
&& apk add --virtual .python-rundeps $runDeps \
5858
&& apk del .build-deps \
59-
&& rm -rf /usr/src/python
59+
&& rm -rf /usr/src/python ~/.cache
6060

6161
# make some useful symlinks that are expected to exist
6262
RUN cd /usr/local/bin \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy