Skip to content

Commit 12db3f7

Browse files
committed
Apply the 3.5 alpine variant changes across the board (now that they've settled)
1 parent 4981110 commit 12db3f7

File tree

15 files changed

+222
-50
lines changed

15 files changed

+222
-50
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ env:
77
- VERSION=3.5 VARIANT=alpine
88
- VERSION=3.4 VARIANT=
99
- VERSION=3.4 VARIANT=slim
10+
- VERSION=3.4 VARIANT=alpine
1011
- VERSION=3.4 VARIANT=wheezy
1112
- VERSION=3.3 VARIANT=
1213
- VERSION=3.3 VARIANT=slim
14+
- VERSION=3.3 VARIANT=alpine
1315
- VERSION=3.3 VARIANT=wheezy
1416
- VERSION=3.2 VARIANT=
1517
- VERSION=3.2 VARIANT=slim
18+
- VERSION=3.2 VARIANT=alpine
1619
- VERSION=3.2 VARIANT=wheezy
1720
- VERSION=2.7 VARIANT=
1821
- VERSION=2.7 VARIANT=slim

2.7/alpine/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ RUN set -ex \
5454
| sort -u \
5555
)" \
5656
&& apk add --virtual .python-rundeps $runDeps \
57-
&& apk del .fetch-deps \
58-
&& apk del .build-deps \
57+
&& apk del .build-deps .fetch-deps \
5958
&& rm -rf /usr/src/python
6059

6160
CMD ["python2"]

2.7/wheezy/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key 18ADD4FF: public key "Benjamin Peterson <benjamin@python.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
11+
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1212

1313
ENV PYTHON_VERSION 2.7.11
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
2020
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
2121
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
2526
&& cd /usr/src/python \

3.2/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
11+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1212

1313
ENV PYTHON_VERSION 3.2.6
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
20-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
20+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
26+
&& rm -r ~/.gnupg \
27+
\
2528
&& cd /usr/src/python \
2629
&& ./configure --enable-shared --enable-unicode=ucs4 \
2730
&& make -j$(nproc) \

3.2/slim/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
17-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
17+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1818

1919
ENV PYTHON_VERSION 3.2.6
2020

2121
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
2222
ENV PYTHON_PIP_VERSION 7.1.2
2323

24-
RUN set -x \
24+
RUN set -ex \
2525
&& buildDeps=' \
2626
curl \
2727
gcc \
@@ -36,12 +36,15 @@ RUN set -x \
3636
zlib1g-dev \
3737
' \
3838
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
39-
&& mkdir -p /usr/src/python \
40-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
41-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
39+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
40+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
41+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
4242
&& gpg --verify python.tar.xz.asc \
43+
&& mkdir -p /usr/src/python \
4344
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
4445
&& rm python.tar.xz* \
46+
&& rm -r ~/.gnupg \
47+
\
4548
&& cd /usr/src/python \
4649
&& ./configure --enable-shared --enable-unicode=ucs4 \
4750
&& make -j$(nproc) \

3.2/wheezy/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
11+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1212

1313
ENV PYTHON_VERSION 3.2.6
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
20-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
20+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
2526
&& cd /usr/src/python \

3.3/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
11+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1212

1313
ENV PYTHON_VERSION 3.3.6
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
20-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
20+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
26+
&& rm -r ~/.gnupg \
27+
\
2528
&& cd /usr/src/python \
2629
&& ./configure --enable-shared --enable-unicode=ucs4 \
2730
&& make -j$(nproc) \

3.3/alpine/Dockerfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM alpine:3.3
2+
3+
# http://bugs.python.org/issue19846
4+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
5+
ENV LANG C.UTF-8
6+
7+
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
8+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
9+
10+
ENV PYTHON_VERSION 3.3.6
11+
12+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
13+
ENV PYTHON_PIP_VERSION 7.1.2
14+
15+
RUN set -ex \
16+
&& apk add --no-cache --virtual .fetch-deps curl gnupg \
17+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
18+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
19+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
20+
&& gpg --verify python.tar.xz.asc \
21+
&& mkdir -p /usr/src \
22+
&& tar -xJC /usr/src -f python.tar.xz \
23+
&& mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \
24+
&& rm python.tar.xz* \
25+
&& rm -r ~/.gnupg \
26+
\
27+
&& apk add --no-cache --virtual .build-deps \
28+
bzip2-dev \
29+
gcc \
30+
libc-dev \
31+
linux-headers \
32+
make \
33+
ncurses-dev \
34+
openssl-dev \
35+
pax-utils \
36+
readline-dev \
37+
sqlite-dev \
38+
zlib-dev \
39+
&& cd /usr/src/python \
40+
&& ./configure --enable-shared --enable-unicode=ucs4 \
41+
&& make -j$(getconf _NPROCESSORS_ONLN) \
42+
&& make install \
43+
&& curl -fSL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
44+
&& pip install --no-cache-dir --upgrade pip==$PYTHON_PIP_VERSION \
45+
&& find /usr/local \
46+
\( -type d -a -name test -o -name tests \) \
47+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
48+
-exec rm -rf '{}' + \
49+
&& runDeps="$( \
50+
scanelf --needed --nobanner --recursive /usr/local \
51+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
52+
| sort -u \
53+
| xargs -r apk info --installed \
54+
| sort -u \
55+
)" \
56+
&& apk add --virtual .python-rundeps $runDeps \
57+
&& apk del .build-deps .fetch-deps \
58+
&& rm -rf /usr/src/python
59+
60+
# make some useful symlinks that are expected to exist
61+
RUN cd /usr/local/bin \
62+
&& ln -s idle3 idle \
63+
&& ln -s pydoc3 pydoc \
64+
&& ln -s python3 python \
65+
&& ln -s python-config3 python-config
66+
67+
CMD ["python3"]

3.3/slim/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
17-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
17+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1818

1919
ENV PYTHON_VERSION 3.3.6
2020

2121
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
2222
ENV PYTHON_PIP_VERSION 7.1.2
2323

24-
RUN set -x \
24+
RUN set -ex \
2525
&& buildDeps=' \
2626
curl \
2727
gcc \
@@ -36,12 +36,15 @@ RUN set -x \
3636
zlib1g-dev \
3737
' \
3838
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
39-
&& mkdir -p /usr/src/python \
40-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
41-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
39+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
40+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
41+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
4242
&& gpg --verify python.tar.xz.asc \
43+
&& mkdir -p /usr/src/python \
4344
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
4445
&& rm python.tar.xz* \
46+
&& rm -r ~/.gnupg \
47+
\
4548
&& cd /usr/src/python \
4649
&& ./configure --enable-shared --enable-unicode=ucs4 \
4750
&& make -j$(nproc) \

3.3/wheezy/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
11+
ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
1212

1313
ENV PYTHON_VERSION 3.3.6
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
20-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
20+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
26+
&& rm -r ~/.gnupg \
27+
\
2528
&& cd /usr/src/python \
2629
&& ./configure --enable-shared --enable-unicode=ucs4 \
2730
&& make -j$(nproc) \

3.4/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ RUN apt-get purge -y python.*
88
ENV LANG C.UTF-8
99

1010
# gpg: key F73C700D: public key "Larry Hastings <larry@hastings.org>" imported
11-
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
11+
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
1212

1313
ENV PYTHON_VERSION 3.4.4
1414

1515
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

18-
RUN set -x \
19-
&& mkdir -p /usr/src/python \
20-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21-
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
18+
RUN set -ex \
19+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
20+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2222
&& gpg --verify python.tar.xz.asc \
23+
&& mkdir -p /usr/src/python \
2324
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2425
&& rm python.tar.xz* \
26+
&& rm -r ~/.gnupg \
27+
\
2528
&& cd /usr/src/python \
2629
&& ./configure --enable-shared --enable-unicode=ucs4 \
2730
&& make -j$(nproc) \

3.4/alpine/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM alpine:3.3
2+
3+
# http://bugs.python.org/issue19846
4+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
5+
ENV LANG C.UTF-8
6+
7+
# gpg: key F73C700D: public key "Larry Hastings <larry@hastings.org>" imported
8+
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
9+
10+
ENV PYTHON_VERSION 3.4.4
11+
12+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
13+
ENV PYTHON_PIP_VERSION 7.1.2
14+
15+
RUN set -ex \
16+
&& apk add --no-cache --virtual .fetch-deps curl gnupg \
17+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
18+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
19+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
20+
&& gpg --verify python.tar.xz.asc \
21+
&& mkdir -p /usr/src \
22+
&& tar -xJC /usr/src -f python.tar.xz \
23+
&& mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \
24+
&& rm python.tar.xz* \
25+
&& rm -r ~/.gnupg \
26+
&& apk del .fetch-deps \
27+
\
28+
&& apk add --no-cache --virtual .build-deps \
29+
bzip2-dev \
30+
gcc \
31+
libc-dev \
32+
linux-headers \
33+
make \
34+
ncurses-dev \
35+
openssl-dev \
36+
pax-utils \
37+
readline-dev \
38+
sqlite-dev \
39+
zlib-dev \
40+
&& cd /usr/src/python \
41+
&& ./configure --enable-shared --enable-unicode=ucs4 \
42+
&& make -j$(getconf _NPROCESSORS_ONLN) \
43+
&& make install \
44+
&& pip3 install --no-cache-dir --upgrade --ignore-installed pip==$PYTHON_PIP_VERSION \
45+
&& find /usr/local \
46+
\( -type d -a -name test -o -name tests \) \
47+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
48+
-exec rm -rf '{}' + \
49+
&& runDeps="$( \
50+
scanelf --needed --nobanner --recursive /usr/local \
51+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
52+
| sort -u \
53+
| xargs -r apk info --installed \
54+
| sort -u \
55+
)" \
56+
&& apk add --virtual .python-rundeps $runDeps \
57+
&& apk del .build-deps \
58+
&& rm -rf /usr/src/python
59+
60+
# make some useful symlinks that are expected to exist
61+
RUN cd /usr/local/bin \
62+
&& ln -s easy_install-3.4 easy_install \
63+
&& ln -s idle3 idle \
64+
&& ln -s pydoc3 pydoc \
65+
&& ln -s python3 python \
66+
&& ln -s python-config3 python-config
67+
68+
CMD ["python3"]

0 commit comments

Comments
 (0)