@@ -75,21 +75,21 @@ RUN set -eux; \
75
75
--enable-shared \
76
76
--with-lto \
77
77
--with-system-expat \
78
- --with -ensurepip \
78
+ --without -ensurepip \
79
79
; \
80
80
nproc="$(nproc)" ; \
81
81
EXTRA_CFLAGS="$(dpkg-buildflags --get CFLAGS)" ; \
82
82
LDFLAGS="$(dpkg-buildflags --get LDFLAGS)" ; \
83
83
LDFLAGS="${LDFLAGS:--Wl},--strip-all" ; \
84
- make -s - j "$nproc" \
84
+ make -j "$nproc" \
85
85
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
86
86
"LDFLAGS=${LDFLAGS:-}" \
87
87
"PROFILE_TASK=${PROFILE_TASK:-}" \
88
88
; \
89
89
# https://github.com/docker-library/python/issues/784
90
90
# prevent accidental usage of a system installed libpython of the same version
91
91
rm python; \
92
- make -s - j "$nproc" \
92
+ make -j "$nproc" \
93
93
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
94
94
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ ORIGIN/../lib'" \
95
95
"PROFILE_TASK=${PROFILE_TASK:-}" \
@@ -123,16 +123,46 @@ RUN set -eux; \
123
123
rm -rf /var/lib/apt/lists/*; \
124
124
\
125
125
export PYTHONDONTWRITEBYTECODE=1; \
126
- python3 --version; \
127
- pip3 --version
126
+ python3 --version
128
127
129
128
# make some useful symlinks that are expected to exist ("/usr/local/bin/python" and friends)
130
129
RUN set -eux; \
131
- for src in idle3 pip3 pydoc3 python3 python3-config; do \
130
+ for src in idle3 pydoc3 python3 python3-config; do \
132
131
dst="$(echo " $src" | tr -d 3)" ; \
133
132
[ -s "/usr/local/bin/$src" ]; \
134
133
[ ! -e "/usr/local/bin/$dst" ]; \
135
134
ln -svT "$src" "/usr/local/bin/$dst" ; \
136
135
done
137
136
137
+ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
138
+ ENV PYTHON_PIP_VERSION=24.2
139
+ # https://github.com/pypa/get-pip
140
+ ENV PYTHON_GET_PIP_URL=https://raw.githubusercontent.com/pypa/get-pip/HEAD/public/get-pip.py
141
+
142
+ RUN set -eux; \
143
+ \
144
+ savedAptMark="$(apt-mark showmanual)" ; \
145
+ apt-get update; \
146
+ apt-get install -y --no-install-recommends wget; \
147
+ \
148
+ wget -q -O get-pip.py "$PYTHON_GET_PIP_URL" ; \
149
+ \
150
+ apt-mark auto '.*' > /dev/null; \
151
+ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
152
+ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
153
+ rm -rf /var/lib/apt/lists/*; \
154
+ \
155
+ export PYTHONDONTWRITEBYTECODE=1; \
156
+ \
157
+ python get-pip.py \
158
+ --disable-pip-version-check \
159
+ --no-compile \
160
+ "pip==$PYTHON_PIP_VERSION" \
161
+ --no-setuptools \
162
+ --no-wheel \
163
+ ; \
164
+ rm -f get-pip.py; \
165
+ \
166
+ pip --version
167
+
138
168
CMD ["python3" ]
0 commit comments