@@ -14,11 +14,6 @@ RUN apk add --no-cache ca-certificates
1414ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1515ENV PYTHON_VERSION 2.7.13
1616
17- # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
18- ENV PYTHON_PIP_VERSION 9.0.1
19- ENV PYTHON_SETUPTOOLS_VERSION 35.0.2
20- ENV PYTHON_WHEEL_VERSION 0.29.0
21-
2217RUN set -ex \
2318 && apk add --no-cache --virtual .fetch-deps \
2419 gnupg \
@@ -60,26 +55,9 @@ RUN set -ex \
6055 && ./configure \
6156 --enable-shared \
6257 --enable-unicode=ucs4 \
63- && make -j$(getconf _NPROCESSORS_ONLN) \
58+ && make -j " $(getconf _NPROCESSORS_ONLN)" \
6459 && make install \
6560 \
66- && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
67- && python2 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \
68- && rm /tmp/get-pip.py \
69- # we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python
70- # ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages")
71- # https://github.com/docker-library/python/pull/143#issuecomment-241032683
72- && pip install --no-cache-dir --upgrade --force-reinstall \
73- "pip==$PYTHON_PIP_VERSION" \
74- "setuptools==$PYTHON_SETUPTOOLS_VERSION" \
75- "wheel==$PYTHON_WHEEL_VERSION" \
76- \
77- && find /usr/local -depth \
78- \( \
79- \( -type d -a -name test -o -name tests \) \
80- -o \
81- \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
82- \) -exec rm -rf '{}' + \
8361 && runDeps="$( \
8462 scanelf --needed --nobanner --recursive /usr/local \
8563 | awk '{ gsub(/,/, " \n so:", $2); print " so:" $2 }' \
@@ -89,6 +67,39 @@ RUN set -ex \
8967 )" \
9068 && apk add --virtual .python-rundeps $runDeps \
9169 && apk del .build-deps \
92- && rm -rf /usr/src/python ~/.cache
70+ \
71+ && find /usr/local -depth \
72+ \( \
73+ \( -type d -a -name test -o -name tests \) \
74+ -o \
75+ \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
76+ \) -exec rm -rf '{}' + \
77+ && rm -rf /usr/src/python
78+
79+ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
80+ ENV PYTHON_PIP_VERSION 9.0.1
81+
82+ RUN set -ex; \
83+ \
84+ apk add --no-cache --virtual .fetch-deps openssl; \
85+ \
86+ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
87+ \
88+ apk del .fetch-deps; \
89+ \
90+ python get-pip.py \
91+ --disable-pip-version-check \
92+ --no-cache-dir \
93+ "pip==$PYTHON_PIP_VERSION" \
94+ ; \
95+ pip --version; \
96+ \
97+ find /usr/local -depth \
98+ \( \
99+ \( -type d -a -name test -o -name tests \) \
100+ -o \
101+ \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
102+ \) -exec rm -rf '{}' +; \
103+ rm -f get-pip.py
93104
94105CMD ["python2" ]
0 commit comments