Skip to content

Commit d8cda13

Browse files
JayH5tianon
authored andcommitted
Add Debian Stretch variants (#208)
* Try add a Debian Stretch variant * Update Travis too * update.sh: Also update Travis file
1 parent d83e742 commit d8cda13

File tree

4 files changed

+186
-1
lines changed

4 files changed

+186
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
- VERSION=3.6 VARIANT=slim
77
- VERSION=3.6 VARIANT=alpine
88
- VERSION=3.6 VARIANT=alpine3.6
9+
- VERSION=3.6 VARIANT=stretch
910
- VERSION=3.5 VARIANT=
1011
- VERSION=3.5 VARIANT=slim
1112
- VERSION=3.5 VARIANT=alpine
@@ -21,6 +22,7 @@ env:
2122
- VERSION=2.7 VARIANT=slim
2223
- VERSION=2.7 VARIANT=alpine
2324
- VERSION=2.7 VARIANT=alpine3.6
25+
- VERSION=2.7 VARIANT=stretch
2426
- VERSION=2.7 VARIANT=wheezy
2527

2628
install:

2.7/stretch/Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM buildpack-deps:stretch
2+
3+
# ensure local python is preferred over distribution python
4+
ENV PATH /usr/local/bin:$PATH
5+
6+
# http://bugs.python.org/issue19846
7+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
8+
ENV LANG C.UTF-8
9+
10+
# runtime dependencies
11+
RUN apt-get update && apt-get install -y --no-install-recommends \
12+
tcl \
13+
tk \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
17+
ENV PYTHON_VERSION 2.7.13
18+
19+
RUN set -ex \
20+
&& buildDeps=' \
21+
dpkg-dev \
22+
tcl-dev \
23+
tk-dev \
24+
' \
25+
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
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 --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
31+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
32+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
33+
&& mkdir -p /usr/src/python \
34+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
35+
&& rm python.tar.xz \
36+
\
37+
&& cd /usr/src/python \
38+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
39+
&& ./configure \
40+
--build="$gnuArch" \
41+
--enable-shared \
42+
--enable-unicode=ucs4 \
43+
&& make -j "$(nproc)" \
44+
&& make install \
45+
&& ldconfig \
46+
\
47+
&& apt-get purge -y --auto-remove $buildDeps \
48+
\
49+
&& find /usr/local -depth \
50+
\( \
51+
\( -type d -a -name test -o -name tests \) \
52+
-o \
53+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
54+
\) -exec rm -rf '{}' + \
55+
&& rm -rf /usr/src/python
56+
57+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
58+
ENV PYTHON_PIP_VERSION 9.0.1
59+
60+
RUN set -ex; \
61+
\
62+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
63+
\
64+
python get-pip.py \
65+
--disable-pip-version-check \
66+
--no-cache-dir \
67+
"pip==$PYTHON_PIP_VERSION" \
68+
; \
69+
pip --version; \
70+
\
71+
find /usr/local -depth \
72+
\( \
73+
\( -type d -a -name test -o -name tests \) \
74+
-o \
75+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
76+
\) -exec rm -rf '{}' +; \
77+
rm -f get-pip.py
78+
79+
# install "virtualenv", since the vast majority of users of this image will want it
80+
RUN pip install --no-cache-dir virtualenv
81+
82+
CMD ["python2"]

3.6/stretch/Dockerfile

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

update.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ for version in "${versions[@]}"; do
126126
-e 's/openssl/libressl/g' \
127127
"$version/alpine3.6/Dockerfile"
128128
fi
129-
for variant in wheezy alpine3.6 alpine slim ''; do
129+
if [ -d "$version/stretch" ]; then
130+
cp "$version/Dockerfile" "$version/stretch/Dockerfile"
131+
sed -ri \
132+
-e 's/:jessie/:stretch/g' \
133+
"$version/stretch/Dockerfile"
134+
fi
135+
for variant in wheezy stretch alpine3.6 alpine slim ''; do
130136
[ -d "$version/$variant" ] || continue
131137
travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv"
132138
done

0 commit comments

Comments
 (0)