1+ #
2+ # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+ #
4+ # PLEASE DO NOT EDIT IT DIRECTLY.
5+ #
6+
17FROM alpine:3.4
28
9+ # ensure local python is used over alpine python
10+ ENV PATH /usr/local/bin:$PATH
11+
312# http://bugs.python.org/issue19846
413# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
514ENV LANG C.UTF-8
@@ -8,18 +17,21 @@ ENV LANG C.UTF-8
817# the other runtime dependencies for Python are installed later
918RUN apk add --no-cache ca-certificates
1019
11- # gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
1220ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288
13-
1421ENV PYTHON_VERSION 3.3.6
1522
1623# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1724ENV PYTHON_PIP_VERSION 8.1.2
1825
1926RUN set -ex \
20- && apk add --no-cache --virtual .fetch-deps curl gnupg tar xz \
21- && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
22- && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
27+ && apk add --no-cache --virtual .fetch-deps \
28+ gnupg \
29+ openssl \
30+ tar \
31+ xz \
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" \
2335 && export GNUPGHOME="$(mktemp -d)" \
2436 && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
2537 && gpg --batch --verify python.tar.xz.asc python.tar.xz \
@@ -35,6 +47,7 @@ RUN set -ex \
3547 linux-headers \
3648 make \
3749 ncurses-dev \
50+ openssl \
3851 openssl-dev \
3952 pax-utils \
4053 readline-dev \
@@ -44,15 +57,25 @@ RUN set -ex \
4457 tk-dev \
4558 xz-dev \
4659 zlib-dev \
60+ # add build deps before removing fetch deps in case there's overlap
61+ && apk del .fetch-deps \
62+ \
4763 && cd /usr/src/python \
4864 && ./configure \
4965 --enable-loadable-sqlite-extensions \
5066 --enable-shared \
5167 && make -j$(getconf _NPROCESSORS_ONLN) \
5268 && make install \
53- && curl -fSL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
54- && pip install --no-cache-dir --upgrade pip==$PYTHON_PIP_VERSION \
55- && [ "$(pip list | awk -F '[ ()]+' '$1 == " pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \
69+ \
70+ # explicit path to "pip3" to ensure Debian "pip3" cannot interfere
71+ && if [ ! -e /usr/local/bin/pip3 ]; then : \
72+ && wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
73+ && python3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \
74+ && rm /tmp/get-pip.py \
75+ ; fi \
76+ && pip3 install --no-cache-dir --upgrade "pip==$PYTHON_PIP_VERSION" \
77+ && [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == " pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \
78+ \
5679 && find /usr/local -depth \
5780 \( \
5881 \( -type d -a -name test -o -name tests \) \
@@ -67,11 +90,12 @@ RUN set -ex \
6790 | sort -u \
6891 )" \
6992 && apk add --virtual .python-rundeps $runDeps \
70- && apk del .build-deps .fetch-deps \
93+ && apk del .build-deps \
7194 && rm -rf /usr/src/python ~/.cache
7295
7396# make some useful symlinks that are expected to exist
7497RUN cd /usr/local/bin \
98+ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
7599 && ln -s idle3 idle \
76100 && ln -s pydoc3 pydoc \
77101 && ln -s python3 python \
0 commit comments