1
- #
2
- # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3
- #
4
- # PLEASE DO NOT EDIT IT DIRECTLY.
5
- #
6
1
7
- FROM alpine:3.12
2
+ FROM danielschulz/alpine:v3.12
3
+ MAINTAINER Daniel Schulz <danielschulz2005@hotmail.com>
4
+ LABEL VISION="'We are stubborn on vision. We are flexible on details. We don’t give up on things easily.' (Jeff Bezos)" \
5
+ AGILE_MANIFESTO="https://agilemanifesto.org" \
6
+ SWE_MANIFESTO="https://manifesto.softwarecraftsmanship.org"
8
7
9
8
# ensure local python is preferred over distribution python
10
- ENV PATH /usr/local/bin:$PATH
9
+ ENV PATH /usr/local/bin:${ PATH}
11
10
12
11
# http://bugs.python.org/issue19846
13
12
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
@@ -18,29 +17,33 @@ RUN set -eux; \
18
17
apk add --no-cache \
19
18
# install ca-certificates so that HTTPS works consistently
20
19
ca-certificates \
20
+ # and tzdata for PEP 615 (https://www.python.org/dev/peps/pep-0615/)
21
+ tzdata \
21
22
;
22
23
# other runtime dependencies for Python are installed later
23
24
24
- ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
25
- ENV PYTHON_VERSION 3.6.12
25
+ # use 3.6, 3.7, 3.8, 3.9, (as of now, use "master" for 3.10)
26
+ ARG CPYTHON_GIT_URI="https://github.com/danielschulz/cpython.git"
27
+ ARG CPYTHON_GIT_REFERENCE="v3.6.12"
28
+ ARG PYTHON_VERSION="${CPYTHON_GIT_REFERENCE}"
29
+
30
+ ENV PYTHON_VERSION=${PYTHON_VERSION}
26
31
27
32
RUN set -ex \
28
33
&& apk add --no-cache --virtual .fetch-deps \
29
34
gnupg \
30
35
tar \
31
36
xz \
37
+ git \
32
38
\
33
- && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
34
- && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
35
- && export GNUPGHOME="$(mktemp -d)" \
36
- && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
37
- && gpg --batch --verify python.tar.xz.asc python.tar.xz \
38
- && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
39
- && rm -rf "$GNUPGHOME" python.tar.xz.asc \
40
39
&& mkdir -p /usr/src/python \
41
- && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
42
- && rm python.tar.xz \
43
- \
40
+ && time git clone \
41
+ -b ${CPYTHON_GIT_REFERENCE} \
42
+ --depth 1 \
43
+ --single-branch \
44
+ --recurse-submodules ${CPYTHON_GIT_URI} \
45
+ /usr/src/python \
46
+ && rm -rf /usr/src/python/.git \
44
47
&& apk add --no-cache --virtual .build-deps \
45
48
bluez-dev \
46
49
bzip2-dev \
@@ -64,6 +67,7 @@ RUN set -ex \
64
67
tcl-dev \
65
68
tk \
66
69
tk-dev \
70
+ util-linux-dev \
67
71
xz-dev \
68
72
zlib-dev \
69
73
# add build deps before removing fetch deps in case there's overlap
@@ -72,7 +76,7 @@ RUN set -ex \
72
76
&& cd /usr/src/python \
73
77
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
74
78
&& ./configure \
75
- --build="$gnuArch" \
79
+ --build="${ gnuArch} " \
76
80
--enable-loadable-sqlite-extensions \
77
81
--enable-optimizations \
78
82
--enable-option-checking=fatal \
@@ -85,50 +89,13 @@ RUN set -ex \
85
89
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
86
90
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
87
91
LDFLAGS="-Wl,--strip-all" \
88
- # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916
89
- PROFILE_TASK='-m test.regrtest --pgo \
90
- test_array \
91
- test_base64 \
92
- test_binascii \
93
- test_binhex \
94
- test_binop \
95
- test_bytes \
96
- test_c_locale_coercion \
97
- test_class \
98
- test_cmath \
99
- test_codecs \
100
- test_compile \
101
- test_complex \
102
- test_csv \
103
- test_decimal \
104
- test_dict \
105
- test_float \
106
- test_fstring \
107
- test_hashlib \
108
- test_io \
109
- test_iter \
110
- test_json \
111
- test_long \
112
- test_math \
113
- test_memoryview \
114
- test_pickle \
115
- test_re \
116
- test_set \
117
- test_slice \
118
- test_struct \
119
- test_threading \
120
- test_time \
121
- test_traceback \
122
- test_unicode \
123
- ' \
124
92
&& make install \
125
93
&& rm -rf /usr/src/python \
126
94
\
127
95
&& find /usr/local -depth \
128
96
\( \
129
97
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
130
98
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
131
- -o \( -type f -a -name 'wininst-*.exe' \) \
132
99
\) -exec rm -rf '{}' + \
133
100
\
134
101
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
@@ -148,20 +115,20 @@ RUN cd /usr/local/bin \
148
115
&& ln -s python3-config python-config
149
116
150
117
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
151
- ENV PYTHON_PIP_VERSION 20.3.1
118
+ ENV PYTHON_PIP_VERSION 20.3.3
152
119
# https://github.com/pypa/get-pip
153
- ENV PYTHON_GET_PIP_URL https://github. com/pypa/get-pip/raw/91630a4867b1f93ba0a12aa81d0ec4ecc1e7eeb9 /get-pip.py
154
- ENV PYTHON_GET_PIP_SHA256 d48ae68f297cac54db17e4107b800faae0e5210131f9f386c30c0166bf8d81b7
120
+ ENV PYTHON_GET_PIP_URL https://raw.githubusercontent. com/pypa/get-pip/${PYTHON_PIP_VERSION} /get-pip.py
121
+ ENV PYTHON_GET_PIP_SHA256 6a0b13826862f33c13b614a921d36253bfa1ae779c5fbf569876f3585057e9d2
155
122
156
123
RUN set -ex; \
157
124
\
158
- wget -O get-pip.py "$PYTHON_GET_PIP_URL" ; \
159
- echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \
125
+ wget -q - O get-pip.py "${ PYTHON_GET_PIP_URL} " ; \
126
+ echo "${ PYTHON_GET_PIP_SHA256} *get-pip.py" | sha256sum -c -; \
160
127
\
161
128
python get-pip.py \
162
129
--disable-pip-version-check \
163
130
--no-cache-dir \
164
- "pip==$PYTHON_PIP_VERSION" \
131
+ "pip==${ PYTHON_PIP_VERSION} " \
165
132
; \
166
133
pip --version; \
167
134
\
0 commit comments