Skip to content

Commit e846f9b

Browse files
authored
Merge pull request #399 from J0WI/alpine10
Add Alpine 3.10 and remove Alpine 3.8
2 parents 1358d77 + e057559 commit e846f9b

File tree

7 files changed

+644
-21
lines changed

7 files changed

+644
-21
lines changed

.travis.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ matrix:
1010
env: VERSION=3.8-rc VARIANT=stretch
1111
- os: linux
1212
env: VERSION=3.8-rc VARIANT=stretch/slim
13+
- os: linux
14+
env: VERSION=3.8-rc VARIANT=alpine3.10
1315
- os: linux
1416
env: VERSION=3.8-rc VARIANT=alpine3.9
1517
- os: windows
@@ -20,9 +22,9 @@ matrix:
2022
- os: linux
2123
env: VERSION=3.7 VARIANT=stretch/slim
2224
- os: linux
23-
env: VERSION=3.7 VARIANT=alpine3.9
25+
env: VERSION=3.7 VARIANT=alpine3.10
2426
- os: linux
25-
env: VERSION=3.7 VARIANT=alpine3.8
27+
env: VERSION=3.7 VARIANT=alpine3.9
2628
- os: windows
2729
dist: 1803-containers
2830
env: VERSION=3.6 VARIANT=windows/windowsservercore-1803
@@ -35,9 +37,9 @@ matrix:
3537
- os: linux
3638
env: VERSION=3.6 VARIANT=jessie/slim
3739
- os: linux
38-
env: VERSION=3.6 VARIANT=alpine3.9
40+
env: VERSION=3.6 VARIANT=alpine3.10
3941
- os: linux
40-
env: VERSION=3.6 VARIANT=alpine3.8
42+
env: VERSION=3.6 VARIANT=alpine3.9
4143
- os: linux
4244
env: VERSION=3.5 VARIANT=stretch
4345
- os: linux
@@ -47,9 +49,9 @@ matrix:
4749
- os: linux
4850
env: VERSION=3.5 VARIANT=jessie/slim
4951
- os: linux
50-
env: VERSION=3.5 VARIANT=alpine3.9
52+
env: VERSION=3.5 VARIANT=alpine3.10
5153
- os: linux
52-
env: VERSION=3.5 VARIANT=alpine3.8
54+
env: VERSION=3.5 VARIANT=alpine3.9
5355
- os: windows
5456
dist: 1803-containers
5557
env: VERSION=2.7 VARIANT=windows/windowsservercore-1803
@@ -62,9 +64,9 @@ matrix:
6264
- os: linux
6365
env: VERSION=2.7 VARIANT=jessie/slim
6466
- os: linux
65-
env: VERSION=2.7 VARIANT=alpine3.9
67+
env: VERSION=2.7 VARIANT=alpine3.10
6668
- os: linux
67-
env: VERSION=2.7 VARIANT=alpine3.8
69+
env: VERSION=2.7 VARIANT=alpine3.9
6870

6971
install:
7072
- git clone https://github.com/docker-library/official-images.git ~/official-images

2.7/alpine3.10/Dockerfile

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.10
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+
# https://github.com/docker-library/python/issues/147
16+
ENV PYTHONIOENCODING UTF-8
17+
18+
# install ca-certificates so that HTTPS works consistently
19+
# other runtime dependencies for Python are installed later
20+
RUN apk add --no-cache ca-certificates
21+
22+
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
23+
ENV PYTHON_VERSION 2.7.16
24+
25+
RUN set -ex \
26+
&& apk add --no-cache --virtual .fetch-deps \
27+
gnupg \
28+
tar \
29+
xz \
30+
\
31+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
32+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
33+
&& export GNUPGHOME="$(mktemp -d)" \
34+
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
35+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
36+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
37+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
38+
&& mkdir -p /usr/src/python \
39+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
40+
&& rm python.tar.xz \
41+
\
42+
&& apk add --no-cache --virtual .build-deps \
43+
bzip2-dev \
44+
coreutils \
45+
dpkg-dev dpkg \
46+
expat-dev \
47+
findutils \
48+
gcc \
49+
gdbm-dev \
50+
libc-dev \
51+
libffi-dev \
52+
libnsl-dev \
53+
libtirpc-dev \
54+
linux-headers \
55+
make \
56+
ncurses-dev \
57+
openssl-dev \
58+
pax-utils \
59+
readline-dev \
60+
sqlite-dev \
61+
tcl-dev \
62+
tk \
63+
tk-dev \
64+
zlib-dev \
65+
# add build deps before removing fetch deps in case there's overlap
66+
&& apk del .fetch-deps \
67+
\
68+
&& cd /usr/src/python \
69+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
70+
&& ./configure \
71+
--build="$gnuArch" \
72+
--enable-shared \
73+
--enable-unicode=ucs4 \
74+
--with-system-expat \
75+
--with-system-ffi \
76+
&& make -j "$(nproc)" \
77+
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
78+
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
79+
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
80+
&& make install \
81+
\
82+
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
83+
| tr ',' '\n' \
84+
| sort -u \
85+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
86+
| xargs -rt apk add --no-cache --virtual .python-rundeps \
87+
&& apk del .build-deps \
88+
\
89+
&& find /usr/local -depth \
90+
\( \
91+
\( -type d -a \( -name test -o -name tests \) \) \
92+
-o \
93+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
94+
\) -exec rm -rf '{}' + \
95+
&& rm -rf /usr/src/python \
96+
\
97+
&& python2 --version
98+
99+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
100+
ENV PYTHON_PIP_VERSION 19.1.1
101+
102+
RUN set -ex; \
103+
\
104+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
105+
\
106+
python get-pip.py \
107+
--disable-pip-version-check \
108+
--no-cache-dir \
109+
"pip==$PYTHON_PIP_VERSION" \
110+
; \
111+
pip --version; \
112+
\
113+
find /usr/local -depth \
114+
\( \
115+
\( -type d -a \( -name test -o -name tests \) \) \
116+
-o \
117+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
118+
\) -exec rm -rf '{}' +; \
119+
rm -f get-pip.py
120+
121+
CMD ["python2"]

3.5/alpine3.10/Dockerfile

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.10
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+
# install ca-certificates so that HTTPS works consistently
17+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
20+
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
21+
ENV PYTHON_VERSION 3.5.7
22+
23+
RUN set -ex \
24+
&& apk add --no-cache --virtual .fetch-deps \
25+
gnupg \
26+
tar \
27+
xz \
28+
\
29+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
30+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
33+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
34+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
35+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
36+
&& mkdir -p /usr/src/python \
37+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
38+
&& rm python.tar.xz \
39+
\
40+
&& apk add --no-cache --virtual .build-deps \
41+
bzip2-dev \
42+
coreutils \
43+
dpkg-dev dpkg \
44+
expat-dev \
45+
findutils \
46+
gcc \
47+
gdbm-dev \
48+
libc-dev \
49+
libffi-dev \
50+
linux-headers \
51+
make \
52+
ncurses-dev \
53+
openssl-dev \
54+
pax-utils \
55+
readline-dev \
56+
sqlite-dev \
57+
tcl-dev \
58+
tk \
59+
tk-dev \
60+
xz-dev \
61+
zlib-dev \
62+
# add build deps before removing fetch deps in case there's overlap
63+
&& apk del .fetch-deps \
64+
\
65+
&& cd /usr/src/python \
66+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
67+
&& ./configure \
68+
--build="$gnuArch" \
69+
--enable-loadable-sqlite-extensions \
70+
--enable-shared \
71+
--with-system-expat \
72+
--with-system-ffi \
73+
--without-ensurepip \
74+
&& make -j "$(nproc)" \
75+
# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit()
76+
# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0
77+
EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \
78+
&& make install \
79+
\
80+
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \
81+
| tr ',' '\n' \
82+
| sort -u \
83+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
84+
| xargs -rt apk add --no-cache --virtual .python-rundeps \
85+
&& apk del .build-deps \
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 -rf /usr/src/python \
94+
\
95+
&& python3 --version
96+
97+
# make some useful symlinks that are expected to exist
98+
RUN cd /usr/local/bin \
99+
&& ln -s idle3 idle \
100+
&& ln -s pydoc3 pydoc \
101+
&& ln -s python3 python \
102+
&& ln -s python3-config python-config
103+
104+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
105+
ENV PYTHON_PIP_VERSION 19.1.1
106+
107+
RUN set -ex; \
108+
\
109+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
110+
\
111+
python get-pip.py \
112+
--disable-pip-version-check \
113+
--no-cache-dir \
114+
"pip==$PYTHON_PIP_VERSION" \
115+
; \
116+
pip --version; \
117+
\
118+
find /usr/local -depth \
119+
\( \
120+
\( -type d -a \( -name test -o -name tests \) \) \
121+
-o \
122+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
123+
\) -exec rm -rf '{}' +; \
124+
rm -f get-pip.py
125+
126+
CMD ["python3"]

0 commit comments

Comments
 (0)