Skip to content

Commit a5d05f5

Browse files
committed
add support for debian:buster
1 parent 3bfd4c5 commit a5d05f5

File tree

4 files changed

+228
-2
lines changed

4 files changed

+228
-2
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ language: bash
22
services: docker
33

44
env:
5+
- VERSION=3.7 VARIANT=buster
6+
- VERSION=3.7 VARIANT=buster/slim
57
- VERSION=3.7 VARIANT=stretch
68
- VERSION=3.7 VARIANT=stretch/slim
79
- VERSION=3.7 VARIANT=alpine3.8

3.7/buster/Dockerfile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM buildpack-deps:buster
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+
# extra dependencies (over what buildpack-deps already includes)
17+
RUN apt-get update && apt-get install -y --no-install-recommends \
18+
tk-dev \
19+
uuid-dev \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
23+
ENV PYTHON_VERSION 3.7.1
24+
25+
RUN set -ex \
26+
\
27+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
28+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
29+
&& export GNUPGHOME="$(mktemp -d)" \
30+
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
31+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
32+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
33+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
34+
&& mkdir -p /usr/src/python \
35+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
36+
&& rm python.tar.xz \
37+
\
38+
&& cd /usr/src/python \
39+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
40+
&& ./configure \
41+
--build="$gnuArch" \
42+
--enable-loadable-sqlite-extensions \
43+
--enable-shared \
44+
--with-system-expat \
45+
--with-system-ffi \
46+
--without-ensurepip \
47+
&& make -j "$(nproc)" \
48+
&& make install \
49+
&& ldconfig \
50+
\
51+
&& find /usr/local -depth \
52+
\( \
53+
\( -type d -a \( -name test -o -name tests \) \) \
54+
-o \
55+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
56+
\) -exec rm -rf '{}' + \
57+
&& rm -rf /usr/src/python \
58+
\
59+
&& python3 --version
60+
61+
# make some useful symlinks that are expected to exist
62+
RUN cd /usr/local/bin \
63+
&& ln -s idle3 idle \
64+
&& ln -s pydoc3 pydoc \
65+
&& ln -s python3 python \
66+
&& ln -s python3-config python-config
67+
68+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
69+
ENV PYTHON_PIP_VERSION 18.1
70+
71+
RUN set -ex; \
72+
\
73+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
74+
\
75+
python get-pip.py \
76+
--disable-pip-version-check \
77+
--no-cache-dir \
78+
"pip==$PYTHON_PIP_VERSION" \
79+
; \
80+
pip --version; \
81+
\
82+
find /usr/local -depth \
83+
\( \
84+
\( -type d -a \( -name test -o -name tests \) \) \
85+
-o \
86+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
87+
\) -exec rm -rf '{}' +; \
88+
rm -f get-pip.py
89+
90+
CMD ["python3"]

3.7/buster/slim/Dockerfile

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

update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ for version in "${versions[@]}"; do
113113

114114
for v in \
115115
alpine{3.6,3.7,3.8} \
116-
{wheezy,jessie,stretch}{/slim,} \
116+
{wheezy,jessie,stretch,buster}{/slim,} \
117117
windows/nanoserver-{1709,sac2016} \
118118
windows/windowsservercore-{1709,ltsc2016} \
119119
; do
@@ -193,7 +193,7 @@ for version in "${versions[@]}"; do
193193
# older Python needs older OpenSSL
194194
sed -ri -e 's/libssl-dev/libssl1.0-dev/g' "$dir/Dockerfile"
195195
;;
196-
*/stretch | */jessie | */wheezy)
196+
*/buster | */stretch | */jessie | */wheezy)
197197
# buildpack-deps already includes libssl-dev
198198
sed -ri -e '/libssl-dev/d' "$dir/Dockerfile"
199199
;;

0 commit comments

Comments
 (0)