Skip to content

Commit e4087a4

Browse files
committed
Update to 3.6.7, pip 20.0.2
1 parent 64ab8fd commit e4087a4

File tree

1 file changed

+171
-0
lines changed

1 file changed

+171
-0
lines changed

3.6.7/alpine3.11/Dockerfile

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.11
8+
9+
# ensure local python is preferred over distribution python
10+
ENV PATH /usr/local/bin:$PATH
11+
12+
# http://bugs.python.org/issue19846
13+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14+
ENV LANG C.UTF-8
15+
16+
# install ca-certificates so that HTTPS works consistently
17+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
20+
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
21+
ENV PYTHON_VERSION 3.6.7
22+
23+
RUN set -ex \
24+
&& apk add --no-cache --virtual .fetch-deps \
25+
gnupg \
26+
tar \
27+
xz \
28+
\
29+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
30+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
33+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
34+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
35+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
36+
&& mkdir -p /usr/src/python \
37+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
38+
&& rm python.tar.xz \
39+
\
40+
&& apk add --no-cache --virtual .build-deps \
41+
bluez-dev \
42+
bzip2-dev \
43+
coreutils \
44+
dpkg-dev dpkg \
45+
expat-dev \
46+
findutils \
47+
gcc \
48+
gdbm-dev \
49+
libc-dev \
50+
libffi-dev \
51+
libnsl-dev \
52+
libtirpc-dev \
53+
linux-headers \
54+
make \
55+
ncurses-dev \
56+
openssl-dev \
57+
pax-utils \
58+
readline-dev \
59+
sqlite-dev \
60+
tcl-dev \
61+
tk \
62+
tk-dev \
63+
xz-dev \
64+
zlib-dev \
65+
# add build deps before removing fetch deps in case there's overlap
66+
&& apk del --no-network .fetch-deps \
67+
\
68+
&& cd /usr/src/python \
69+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
70+
&& ./configure \
71+
--build="$gnuArch" \
72+
--enable-loadable-sqlite-extensions \
73+
--enable-optimizations \
74+
--enable-option-checking=fatal \
75+
--enable-shared \
76+
--with-system-expat \
77+
--with-system-ffi \
78+
--without-ensurepip \
79+
&& make -j "$(nproc)" \
80+
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
81+
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
82+
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
83+
# setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
84+
PROFILE_TASK='-m test.regrtest --pgo \
85+
test_array \
86+
test_base64 \
87+
test_binascii \
88+
test_binhex \
89+
test_binop \
90+
test_bytes \
91+
test_c_locale_coercion \
92+
test_class \
93+
test_cmath \
94+
test_codecs \
95+
test_compile \
96+
test_complex \
97+
test_csv \
98+
test_decimal \
99+
test_dict \
100+
test_float \
101+
test_fstring \
102+
test_hashlib \
103+
test_io \
104+
test_iter \
105+
test_json \
106+
test_long \
107+
test_math \
108+
test_memoryview \
109+
test_pickle \
110+
test_re \
111+
test_set \
112+
test_slice \
113+
test_struct \
114+
test_threading \
115+
test_time \
116+
test_traceback \
117+
test_unicode \
118+
' \
119+
&& make install \
120+
\
121+
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
122+
| tr ',' '\n' \
123+
| sort -u \
124+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
125+
| xargs -rt apk add --no-cache --virtual .python-rundeps \
126+
&& apk del --no-network .build-deps \
127+
\
128+
&& find /usr/local -depth \
129+
\( \
130+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
131+
-o \
132+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
133+
\) -exec rm -rf '{}' + \
134+
&& rm -rf /usr/src/python \
135+
\
136+
&& python3 --version
137+
138+
# make some useful symlinks that are expected to exist
139+
RUN cd /usr/local/bin \
140+
&& ln -s idle3 idle \
141+
&& ln -s pydoc3 pydoc \
142+
&& ln -s python3 python \
143+
&& ln -s python3-config python-config
144+
145+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
146+
ENV PYTHON_PIP_VERSION 20.0.2
147+
# https://github.com/pypa/get-pip
148+
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/d59197a3c169cef378a22428a3fa99d33e080a5d/get-pip.py
149+
ENV PYTHON_GET_PIP_SHA256 421ac1d44c0cf9730a088e337867d974b91bdce4ea2636099275071878cc189e
150+
151+
RUN set -ex; \
152+
\
153+
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
154+
echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \
155+
\
156+
python get-pip.py \
157+
--disable-pip-version-check \
158+
--no-cache-dir \
159+
"pip==$PYTHON_PIP_VERSION" \
160+
; \
161+
pip --version; \
162+
\
163+
find /usr/local -depth \
164+
\( \
165+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
166+
-o \
167+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
168+
\) -exec rm -rf '{}' +; \
169+
rm -f get-pip.py
170+
171+
CMD ["python3"]

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