Skip to content

Commit be14e99

Browse files
committed
Add missing 3.9-rc/buster/slim
This was missed in docker-library/python#439 and noticed in docker-library/python#508.
1 parent 2a45ea6 commit be14e99

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

3.9-rc/buster/slim/Dockerfile

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:buster-slim
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+
# runtime dependencies
17+
RUN apt-get update && apt-get install -y --no-install-recommends \
18+
ca-certificates \
19+
netbase \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568
23+
ENV PYTHON_VERSION 3.9.0b5
24+
25+
RUN set -ex \
26+
\
27+
&& savedAptMark="$(apt-mark showmanual)" \
28+
&& apt-get update && apt-get install -y --no-install-recommends \
29+
dpkg-dev \
30+
gcc \
31+
libbluetooth-dev \
32+
libbz2-dev \
33+
libc6-dev \
34+
libexpat1-dev \
35+
libffi-dev \
36+
libgdbm-dev \
37+
liblzma-dev \
38+
libncursesw5-dev \
39+
libreadline-dev \
40+
libsqlite3-dev \
41+
libssl-dev \
42+
make \
43+
tk-dev \
44+
uuid-dev \
45+
wget \
46+
xz-utils \
47+
zlib1g-dev \
48+
# as of Stretch, "gpg" is no longer included by default
49+
$(command -v gpg > /dev/null || echo 'gnupg dirmngr') \
50+
\
51+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
52+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
53+
&& export GNUPGHOME="$(mktemp -d)" \
54+
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
55+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
56+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
57+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
58+
&& mkdir -p /usr/src/python \
59+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
60+
&& rm python.tar.xz \
61+
\
62+
&& cd /usr/src/python \
63+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
64+
&& ./configure \
65+
--build="$gnuArch" \
66+
--enable-loadable-sqlite-extensions \
67+
--enable-optimizations \
68+
--enable-option-checking=fatal \
69+
--enable-shared \
70+
--with-system-expat \
71+
--with-system-ffi \
72+
--without-ensurepip \
73+
&& make -j "$(nproc)" \
74+
LDFLAGS="-Wl,--strip-all" \
75+
&& make install \
76+
&& rm -rf /usr/src/python \
77+
\
78+
&& find /usr/local -depth \
79+
\( \
80+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
81+
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
82+
\) -exec rm -rf '{}' + \
83+
\
84+
&& ldconfig \
85+
\
86+
&& apt-mark auto '.*' > /dev/null \
87+
&& apt-mark manual $savedAptMark \
88+
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \
89+
| awk '/=>/ { print $(NF-1) }' \
90+
| sort -u \
91+
| xargs -r dpkg-query --search \
92+
| cut -d: -f1 \
93+
| sort -u \
94+
| xargs -r apt-mark manual \
95+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
96+
&& rm -rf /var/lib/apt/lists/* \
97+
\
98+
&& python3 --version
99+
100+
# make some useful symlinks that are expected to exist
101+
RUN cd /usr/local/bin \
102+
&& ln -s idle3 idle \
103+
&& ln -s pydoc3 pydoc \
104+
&& ln -s python3 python \
105+
&& ln -s python3-config python-config
106+
107+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
108+
ENV PYTHON_PIP_VERSION 20.2
109+
# https://github.com/pypa/get-pip
110+
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/cb5b85a8e0c3d13ced611b97816d7490d2f1497e/get-pip.py
111+
ENV PYTHON_GET_PIP_SHA256 a30ff8a3446c592c6d70403a82483716e7b759e8eecba2c8d3f6ecfb34a8d6d7
112+
113+
RUN set -ex; \
114+
\
115+
savedAptMark="$(apt-mark showmanual)"; \
116+
apt-get update; \
117+
apt-get install -y --no-install-recommends wget; \
118+
\
119+
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
120+
echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \
121+
\
122+
apt-mark auto '.*' > /dev/null; \
123+
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
124+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
125+
rm -rf /var/lib/apt/lists/*; \
126+
\
127+
python get-pip.py \
128+
--disable-pip-version-check \
129+
--no-cache-dir \
130+
"pip==$PYTHON_PIP_VERSION" \
131+
; \
132+
pip --version; \
133+
\
134+
find /usr/local -depth \
135+
\( \
136+
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
137+
-o \
138+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
139+
\) -exec rm -rf '{}' +; \
140+
rm -f get-pip.py
141+
142+
CMD ["python3"]

0 commit comments

Comments
 (0)