Skip to content

Commit 6cbbb68

Browse files
authored
Merge pull request docker-library#249 from JayH5/alpine-3.7
Add Alpine 3.7 variants for 2.7 & 3.6, move 3.7 to Alpine 3.7
2 parents ba34cdc + f998d1b commit 6cbbb68

File tree

5 files changed

+240
-3
lines changed

5 files changed

+240
-3
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ services: docker
44
env:
55
- VERSION=3.7-rc VARIANT=stretch
66
- VERSION=3.7-rc VARIANT=stretch/slim
7-
- VERSION=3.7-rc VARIANT=alpine3.6
7+
- VERSION=3.7-rc VARIANT=alpine3.7
88
- VERSION=3.6 VARIANT=stretch
99
- VERSION=3.6 VARIANT=stretch/slim
1010
- VERSION=3.6 VARIANT=jessie
1111
- VERSION=3.6 VARIANT=jessie/slim
12+
- VERSION=3.6 VARIANT=alpine3.7
1213
- VERSION=3.6 VARIANT=alpine3.6
1314
- VERSION=3.6 VARIANT=alpine3.4
1415
- VERSION=3.5 VARIANT=jessie
@@ -23,6 +24,7 @@ env:
2324
- VERSION=2.7 VARIANT=jessie
2425
- VERSION=2.7 VARIANT=jessie/slim
2526
- VERSION=2.7 VARIANT=wheezy
27+
- VERSION=2.7 VARIANT=alpine3.7
2628
- VERSION=2.7 VARIANT=alpine3.6
2729
- VERSION=2.7 VARIANT=alpine3.4
2830

2.7/alpine3.7/Dockerfile

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
FROM alpine:3.7
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+
# install ca-certificates so that HTTPS works consistently
11+
# the other runtime dependencies for Python are installed later
12+
RUN apk add --no-cache ca-certificates
13+
14+
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
15+
ENV PYTHON_VERSION 2.7.14
16+
17+
RUN set -ex \
18+
&& apk add --no-cache --virtual .fetch-deps \
19+
gnupg \
20+
libressl \
21+
tar \
22+
xz \
23+
\
24+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
25+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
26+
&& export GNUPGHOME="$(mktemp -d)" \
27+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
28+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
29+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
30+
&& mkdir -p /usr/src/python \
31+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
32+
&& rm python.tar.xz \
33+
\
34+
&& apk add --no-cache --virtual .build-deps \
35+
bzip2-dev \
36+
coreutils \
37+
dpkg-dev dpkg \
38+
gcc \
39+
gdbm-dev \
40+
libc-dev \
41+
linux-headers \
42+
make \
43+
ncurses-dev \
44+
libressl \
45+
libressl-dev \
46+
pax-utils \
47+
readline-dev \
48+
sqlite-dev \
49+
tcl-dev \
50+
tk \
51+
tk-dev \
52+
zlib-dev \
53+
# add build deps before removing fetch deps in case there's overlap
54+
&& apk del .fetch-deps \
55+
\
56+
&& cd /usr/src/python \
57+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
58+
&& ./configure \
59+
--build="$gnuArch" \
60+
--enable-shared \
61+
--enable-unicode=ucs4 \
62+
&& make -j "$(nproc)" \
63+
&& make install \
64+
\
65+
&& runDeps="$( \
66+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
67+
| tr ',' '\n' \
68+
| sort -u \
69+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
70+
)" \
71+
&& apk add --virtual .python-rundeps $runDeps \
72+
&& apk del .build-deps \
73+
\
74+
&& find /usr/local -depth \
75+
\( \
76+
\( -type d -a \( -name test -o -name tests \) \) \
77+
-o \
78+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
79+
\) -exec rm -rf '{}' + \
80+
&& rm -rf /usr/src/python
81+
82+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
83+
ENV PYTHON_PIP_VERSION 9.0.1
84+
85+
RUN set -ex; \
86+
\
87+
apk add --no-cache --virtual .fetch-deps libressl; \
88+
\
89+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
90+
\
91+
apk del .fetch-deps; \
92+
\
93+
python get-pip.py \
94+
--disable-pip-version-check \
95+
--no-cache-dir \
96+
"pip==$PYTHON_PIP_VERSION" \
97+
; \
98+
pip --version; \
99+
\
100+
find /usr/local -depth \
101+
\( \
102+
\( -type d -a \( -name test -o -name tests \) \) \
103+
-o \
104+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
105+
\) -exec rm -rf '{}' +; \
106+
rm -f get-pip.py
107+
108+
CMD ["python2"]

3.6/alpine3.7/Dockerfile

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.7
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+
# the other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
20+
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
21+
ENV PYTHON_VERSION 3.6.3
22+
23+
RUN set -ex \
24+
&& apk add --no-cache --virtual .fetch-deps \
25+
gnupg \
26+
libressl \
27+
tar \
28+
xz \
29+
\
30+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
31+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
32+
&& export GNUPGHOME="$(mktemp -d)" \
33+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
34+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
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+
gcc \
46+
gdbm-dev \
47+
libc-dev \
48+
libffi-dev \
49+
linux-headers \
50+
make \
51+
ncurses-dev \
52+
libressl \
53+
libressl-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+
&& make install \
76+
\
77+
&& runDeps="$( \
78+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
79+
| tr ',' '\n' \
80+
| sort -u \
81+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
82+
)" \
83+
&& apk add --virtual .python-rundeps $runDeps \
84+
&& apk del .build-deps \
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+
# make some useful symlinks that are expected to exist
95+
RUN cd /usr/local/bin \
96+
&& ln -s idle3 idle \
97+
&& ln -s pydoc3 pydoc \
98+
&& ln -s python3 python \
99+
&& ln -s python3-config python-config
100+
101+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
102+
ENV PYTHON_PIP_VERSION 9.0.1
103+
104+
RUN set -ex; \
105+
\
106+
apk add --no-cache --virtual .fetch-deps libressl; \
107+
\
108+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109+
\
110+
apk del .fetch-deps; \
111+
\
112+
python get-pip.py \
113+
--disable-pip-version-check \
114+
--no-cache-dir \
115+
"pip==$PYTHON_PIP_VERSION" \
116+
; \
117+
pip --version; \
118+
\
119+
find /usr/local -depth \
120+
\( \
121+
\( -type d -a \( -name test -o -name tests \) \) \
122+
-o \
123+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
124+
\) -exec rm -rf '{}' +; \
125+
rm -f get-pip.py
126+
127+
CMD ["python3"]

3.7-rc/alpine3.6/Dockerfile renamed to 3.7-rc/alpine3.7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# PLEASE DO NOT EDIT IT DIRECTLY.
55
#
66

7-
FROM alpine:3.6
7+
FROM alpine:3.7
88

99
# ensure local python is preferred over distribution python
1010
ENV PATH /usr/local/bin:$PATH

update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ for version in "${versions[@]}"; do
9797
echo "$version: $fullVersion"
9898

9999
for v in \
100-
alpine{3.4,3.6} \
100+
alpine{3.4,3.6,3.7} \
101101
{wheezy,jessie,stretch}{/slim,/onbuild,} \
102102
windows/nanoserver-{1709,sac2016} \
103103
windows/windowsservercore-{1709,ltsc2016} \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy