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>
8
4
9
5
# ensure local python is preferred over distribution python
10
- ENV PATH /usr/local/bin:$PATH
6
+ ENV PATH /usr/local/bin:${ PATH}
11
7
12
8
# http://bugs.python.org/issue19846
13
9
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
@@ -18,29 +14,33 @@ RUN set -eux; \
18
14
apk add --no-cache \
19
15
# install ca-certificates so that HTTPS works consistently
20
16
ca-certificates \
17
+ # and tzdata for PEP 615 (https://www.python.org/dev/peps/pep-0615/)
18
+ tzdata \
21
19
;
22
20
# other runtime dependencies for Python are installed later
23
21
24
- ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568
25
- ENV PYTHON_VERSION 3.8.6
22
+ # use 3.6, 3.7, 3.8, 3.9, (as of now, use "master" for 3.10)
23
+ ARG CPYTHON_GIT_URI="https://github.com/danielschulz/cpython.git"
24
+ ARG CPYTHON_GIT_REFERENCE="v3.8.6"
25
+ ARG PYTHON_VERSION="${CPYTHON_GIT_REFERENCE}"
26
+
27
+ ENV PYTHON_VERSION=${PYTHON_VERSION}
26
28
27
29
RUN set -ex \
28
30
&& apk add --no-cache --virtual .fetch-deps \
29
31
gnupg \
30
32
tar \
31
33
xz \
34
+ git \
32
35
\
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
36
&& mkdir -p /usr/src/python \
41
- && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
42
- && rm python.tar.xz \
43
- \
37
+ && time git clone \
38
+ -b ${CPYTHON_GIT_REFERENCE} \
39
+ --depth 1 \
40
+ --single-branch \
41
+ --recurse-submodules ${CPYTHON_GIT_URI} \
42
+ /usr/src/python \
43
+ && rm -rf /usr/src/python/.git \
44
44
&& apk add --no-cache --virtual .build-deps \
45
45
bluez-dev \
46
46
bzip2-dev \
@@ -73,7 +73,7 @@ RUN set -ex \
73
73
&& cd /usr/src/python \
74
74
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
75
75
&& ./configure \
76
- --build="$gnuArch" \
76
+ --build="${ gnuArch} " \
77
77
--enable-loadable-sqlite-extensions \
78
78
--enable-optimizations \
79
79
--enable-option-checking=fatal \
@@ -93,7 +93,6 @@ RUN set -ex \
93
93
\( \
94
94
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
95
95
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
96
- -o \( -type f -a -name 'wininst-*.exe' \) \
97
96
\) -exec rm -rf '{}' + \
98
97
\
99
98
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
@@ -113,20 +112,20 @@ RUN cd /usr/local/bin \
113
112
&& ln -s python3-config python-config
114
113
115
114
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
116
- ENV PYTHON_PIP_VERSION 20.3.1
115
+ ENV PYTHON_PIP_VERSION 20.3.3
117
116
# https://github.com/pypa/get-pip
118
- ENV PYTHON_GET_PIP_URL https://github. com/pypa/get-pip/raw/91630a4867b1f93ba0a12aa81d0ec4ecc1e7eeb9 /get-pip.py
119
- ENV PYTHON_GET_PIP_SHA256 d48ae68f297cac54db17e4107b800faae0e5210131f9f386c30c0166bf8d81b7
117
+ ENV PYTHON_GET_PIP_URL https://raw.githubusercontent. com/pypa/get-pip/${PYTHON_PIP_VERSION} /get-pip.py
118
+ ENV PYTHON_GET_PIP_SHA256 6a0b13826862f33c13b614a921d36253bfa1ae779c5fbf569876f3585057e9d2
120
119
121
120
RUN set -ex; \
122
121
\
123
- wget -O get-pip.py "$PYTHON_GET_PIP_URL" ; \
124
- echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \
122
+ wget -q - O get-pip.py "${ PYTHON_GET_PIP_URL} " ; \
123
+ echo "${ PYTHON_GET_PIP_SHA256} *get-pip.py" | sha256sum -c -; \
125
124
\
126
125
python get-pip.py \
127
126
--disable-pip-version-check \
128
127
--no-cache-dir \
129
- "pip==$PYTHON_PIP_VERSION" \
128
+ "pip==${ PYTHON_PIP_VERSION} " \
130
129
; \
131
130
pip --version; \
132
131
\
0 commit comments