Skip to content

Commit a529ce9

Browse files
committed
got back to latest versions of any CPython release strem; TODO: DRY for Docker images w/ CPython version and PIP version being configuration ARGs on build time
1 parent c861ecb commit a529ce9

File tree

5 files changed

+129
-179
lines changed

5 files changed

+129
-179
lines changed

3.10-rc/alpine3.12/Dockerfile

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#
2-
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3-
#
4-
# PLEASE DO NOT EDIT IT DIRECTLY.
5-
#
61

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"
87

98
# ensure local python is preferred over distribution python
10-
ENV PATH /usr/local/bin:$PATH
9+
ENV PATH /usr/local/bin:${PATH}
1110

1211
# http://bugs.python.org/issue19846
1312
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
@@ -23,26 +22,28 @@ RUN set -eux; \
2322
;
2423
# other runtime dependencies for Python are installed later
2524

26-
ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
27-
ENV PYTHON_VERSION 3.10.0a2
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.10.0a3"
28+
ARG PYTHON_VERSION="${CPYTHON_GIT_REFERENCE}"
29+
30+
ENV PYTHON_VERSION=${PYTHON_VERSION}
2831

2932
RUN set -ex \
3033
&& apk add --no-cache --virtual .fetch-deps \
3134
gnupg \
3235
tar \
3336
xz \
37+
git \
3438
\
35-
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
36-
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
37-
&& export GNUPGHOME="$(mktemp -d)" \
38-
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
39-
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
40-
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
41-
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
4239
&& mkdir -p /usr/src/python \
43-
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
44-
&& rm python.tar.xz \
45-
\
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 \
4647
&& apk add --no-cache --virtual .build-deps \
4748
bluez-dev \
4849
bzip2-dev \
@@ -75,7 +76,7 @@ RUN set -ex \
7576
&& cd /usr/src/python \
7677
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
7778
&& ./configure \
78-
--build="$gnuArch" \
79+
--build="${gnuArch}" \
7980
--enable-loadable-sqlite-extensions \
8081
--enable-optimizations \
8182
--enable-option-checking=fatal \
@@ -114,20 +115,20 @@ RUN cd /usr/local/bin \
114115
&& ln -s python3-config python-config
115116

116117
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
117-
ENV PYTHON_PIP_VERSION 20.3.1
118+
ENV PYTHON_PIP_VERSION 20.3.3
118119
# https://github.com/pypa/get-pip
119-
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/91630a4867b1f93ba0a12aa81d0ec4ecc1e7eeb9/get-pip.py
120-
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
121122

122123
RUN set -ex; \
123124
\
124-
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
125-
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 -; \
126127
\
127128
python get-pip.py \
128129
--disable-pip-version-check \
129130
--no-cache-dir \
130-
"pip==$PYTHON_PIP_VERSION" \
131+
"pip==${PYTHON_PIP_VERSION}" \
131132
; \
132133
pip --version; \
133134
\

3.6/alpine3.12/Dockerfile

Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#
2-
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3-
#
4-
# PLEASE DO NOT EDIT IT DIRECTLY.
5-
#
61

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"
87

98
# ensure local python is preferred over distribution python
10-
ENV PATH /usr/local/bin:$PATH
9+
ENV PATH /usr/local/bin:${PATH}
1110

1211
# http://bugs.python.org/issue19846
1312
# > 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; \
1817
apk add --no-cache \
1918
# install ca-certificates so that HTTPS works consistently
2019
ca-certificates \
20+
# and tzdata for PEP 615 (https://www.python.org/dev/peps/pep-0615/)
21+
tzdata \
2122
;
2223
# other runtime dependencies for Python are installed later
2324

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}
2631

2732
RUN set -ex \
2833
&& apk add --no-cache --virtual .fetch-deps \
2934
gnupg \
3035
tar \
3136
xz \
37+
git \
3238
\
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 \
4039
&& 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 \
4447
&& apk add --no-cache --virtual .build-deps \
4548
bluez-dev \
4649
bzip2-dev \
@@ -64,6 +67,7 @@ RUN set -ex \
6467
tcl-dev \
6568
tk \
6669
tk-dev \
70+
util-linux-dev \
6771
xz-dev \
6872
zlib-dev \
6973
# add build deps before removing fetch deps in case there's overlap
@@ -72,7 +76,7 @@ RUN set -ex \
7276
&& cd /usr/src/python \
7377
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
7478
&& ./configure \
75-
--build="$gnuArch" \
79+
--build="${gnuArch}" \
7680
--enable-loadable-sqlite-extensions \
7781
--enable-optimizations \
7882
--enable-option-checking=fatal \
@@ -85,50 +89,13 @@ RUN set -ex \
8589
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
8690
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
8791
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-
' \
12492
&& make install \
12593
&& rm -rf /usr/src/python \
12694
\
12795
&& find /usr/local -depth \
12896
\( \
12997
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
13098
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
131-
-o \( -type f -a -name 'wininst-*.exe' \) \
13299
\) -exec rm -rf '{}' + \
133100
\
134101
&& 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 \
148115
&& ln -s python3-config python-config
149116

150117
# 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
152119
# 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
155122

156123
RUN set -ex; \
157124
\
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 -; \
160127
\
161128
python get-pip.py \
162129
--disable-pip-version-check \
163130
--no-cache-dir \
164-
"pip==$PYTHON_PIP_VERSION" \
131+
"pip==${PYTHON_PIP_VERSION}" \
165132
; \
166133
pip --version; \
167134
\

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