Skip to content

Commit 8855871

Browse files
authored
Merge pull request #201 from skwashd/alpine-3.6
Add alpine 3.6 variant
2 parents f281133 + 0edfe01 commit 8855871

File tree

5 files changed

+243
-2
lines changed

5 files changed

+243
-2
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ env:
55
- VERSION=3.6 VARIANT=
66
- VERSION=3.6 VARIANT=slim
77
- VERSION=3.6 VARIANT=alpine
8+
- VERSION=3.6 VARIANT=alpine3.6
89
- VERSION=3.5 VARIANT=
910
- VERSION=3.5 VARIANT=slim
1011
- VERSION=3.5 VARIANT=alpine
@@ -19,6 +20,7 @@ env:
1920
- VERSION=2.7 VARIANT=
2021
- VERSION=2.7 VARIANT=slim
2122
- VERSION=2.7 VARIANT=alpine
23+
- VERSION=2.7 VARIANT=alpine3.6
2224
- VERSION=2.7 VARIANT=wheezy
2325

2426
install:

2.7/alpine3.6/Dockerfile

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
FROM alpine:3.6
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.13
16+
17+
RUN set -ex \
18+
&& apk add --no-cache --virtual .fetch-deps \
19+
gnupg \
20+
openssl \
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 -r "$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+
openssl \
45+
openssl-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 --recursive /usr/local \
67+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
68+
| sort -u \
69+
| xargs -r apk info --installed \
70+
| sort -u \
71+
)" \
72+
&& apk add --virtual .python-rundeps $runDeps \
73+
&& apk del .build-deps \
74+
\
75+
&& find /usr/local -depth \
76+
\( \
77+
\( -type d -a -name test -o -name tests \) \
78+
-o \
79+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
80+
\) -exec rm -rf '{}' + \
81+
&& rm -rf /usr/src/python
82+
83+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
84+
ENV PYTHON_PIP_VERSION 9.0.1
85+
86+
RUN set -ex; \
87+
\
88+
apk add --no-cache --virtual .fetch-deps openssl; \
89+
\
90+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
91+
\
92+
apk del .fetch-deps; \
93+
\
94+
python get-pip.py \
95+
--disable-pip-version-check \
96+
--no-cache-dir \
97+
"pip==$PYTHON_PIP_VERSION" \
98+
; \
99+
pip --version; \
100+
\
101+
find /usr/local -depth \
102+
\( \
103+
\( -type d -a -name test -o -name tests \) \
104+
-o \
105+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
106+
\) -exec rm -rf '{}' +; \
107+
rm -f get-pip.py
108+
109+
CMD ["python2"]

3.6/alpine3.6/Dockerfile

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.6
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.1
22+
23+
RUN set -ex \
24+
&& apk add --no-cache --virtual .fetch-deps \
25+
gnupg \
26+
openssl \
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 -r "$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+
gcc \
45+
gdbm-dev \
46+
libc-dev \
47+
linux-headers \
48+
make \
49+
ncurses-dev \
50+
openssl \
51+
openssl-dev \
52+
pax-utils \
53+
readline-dev \
54+
sqlite-dev \
55+
tcl-dev \
56+
tk \
57+
tk-dev \
58+
xz-dev \
59+
zlib-dev \
60+
# add build deps before removing fetch deps in case there's overlap
61+
&& apk del .fetch-deps \
62+
\
63+
&& cd /usr/src/python \
64+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
65+
&& ./configure \
66+
--build="$gnuArch" \
67+
--enable-loadable-sqlite-extensions \
68+
--enable-shared \
69+
--without-ensurepip \
70+
&& make -j "$(nproc)" \
71+
&& make install \
72+
\
73+
&& runDeps="$( \
74+
scanelf --needed --nobanner --recursive /usr/local \
75+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
76+
| sort -u \
77+
| xargs -r apk info --installed \
78+
| sort -u \
79+
)" \
80+
&& apk add --virtual .python-rundeps $runDeps \
81+
&& apk del .build-deps \
82+
\
83+
&& find /usr/local -depth \
84+
\( \
85+
\( -type d -a -name test -o -name tests \) \
86+
-o \
87+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
88+
\) -exec rm -rf '{}' + \
89+
&& rm -rf /usr/src/python
90+
91+
# make some useful symlinks that are expected to exist
92+
RUN cd /usr/local/bin \
93+
&& ln -s idle3 idle \
94+
&& ln -s pydoc3 pydoc \
95+
&& ln -s python3 python \
96+
&& ln -s python3-config python-config
97+
98+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
99+
ENV PYTHON_PIP_VERSION 9.0.1
100+
101+
RUN set -ex; \
102+
\
103+
apk add --no-cache --virtual .fetch-deps openssl; \
104+
\
105+
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
106+
\
107+
apk del .fetch-deps; \
108+
\
109+
python get-pip.py \
110+
--disable-pip-version-check \
111+
--no-cache-dir \
112+
"pip==$PYTHON_PIP_VERSION" \
113+
; \
114+
pip --version; \
115+
\
116+
find /usr/local -depth \
117+
\( \
118+
\( -type d -a -name test -o -name tests \) \
119+
-o \
120+
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
121+
\) -exec rm -rf '{}' +; \
122+
rm -f get-pip.py
123+
124+
CMD ["python3"]

generate-stackbrew-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ for version in "${versions[@]}"; do
6969
EOE
7070

7171
for v in \
72-
slim alpine wheezy onbuild \
72+
slim alpine alpine3.6 wheezy onbuild \
7373
windows/windowsservercore windows/nanoserver \
7474
; do
7575
dir="$version/$v"

update.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ for version in "${versions[@]}"; do
112112
"$version"/{,*/,*/*/}Dockerfile
113113
)
114114
fi
115-
for variant in wheezy alpine slim ''; do
115+
if [ -d "$version/alpine3.6" ]; then
116+
cp "$version/alpine/Dockerfile" "$version/alpine3.6/Dockerfile"
117+
sed -ri \
118+
-e 's/(alpine):3.4/\1:3.6/g' \
119+
"$version/alpine3.6/Dockerfile"
120+
fi
121+
for variant in wheezy alpine3.6 alpine slim ''; do
116122
[ -d "$version/$variant" ] || continue
117123
travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv"
118124
done

0 commit comments

Comments
 (0)