From 12db3f7b07f9704719657a0652357a3ae4cdc1c1 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 14 Jan 2016 14:34:45 -0800 Subject: [PATCH] Apply the 3.5 alpine variant changes across the board (now that they've settled) --- .travis.yml | 3 ++ 2.7/alpine/Dockerfile | 3 +- 2.7/wheezy/Dockerfile | 7 +++-- 3.2/Dockerfile | 13 +++++---- 3.2/slim/Dockerfile | 13 +++++---- 3.2/wheezy/Dockerfile | 11 +++---- 3.3/Dockerfile | 13 +++++---- 3.3/alpine/Dockerfile | 67 ++++++++++++++++++++++++++++++++++++++++++ 3.3/slim/Dockerfile | 13 +++++---- 3.3/wheezy/Dockerfile | 13 +++++---- 3.4/Dockerfile | 13 +++++---- 3.4/alpine/Dockerfile | 68 +++++++++++++++++++++++++++++++++++++++++++ 3.4/slim/Dockerfile | 13 +++++---- 3.4/wheezy/Dockerfile | 13 +++++---- update.sh | 9 ++++++ 15 files changed, 222 insertions(+), 50 deletions(-) create mode 100644 3.3/alpine/Dockerfile create mode 100644 3.4/alpine/Dockerfile diff --git a/.travis.yml b/.travis.yml index 39495b958..c1c71f799 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,15 @@ env: - VERSION=3.5 VARIANT=alpine - VERSION=3.4 VARIANT= - VERSION=3.4 VARIANT=slim + - VERSION=3.4 VARIANT=alpine - VERSION=3.4 VARIANT=wheezy - VERSION=3.3 VARIANT= - VERSION=3.3 VARIANT=slim + - VERSION=3.3 VARIANT=alpine - VERSION=3.3 VARIANT=wheezy - VERSION=3.2 VARIANT= - VERSION=3.2 VARIANT=slim + - VERSION=3.2 VARIANT=alpine - VERSION=3.2 VARIANT=wheezy - VERSION=2.7 VARIANT= - VERSION=2.7 VARIANT=slim diff --git a/2.7/alpine/Dockerfile b/2.7/alpine/Dockerfile index a9fdb1331..f6f00a7ec 100644 --- a/2.7/alpine/Dockerfile +++ b/2.7/alpine/Dockerfile @@ -54,8 +54,7 @@ RUN set -ex \ | sort -u \ )" \ && apk add --virtual .python-rundeps $runDeps \ - && apk del .fetch-deps \ - && apk del .build-deps \ + && apk del .build-deps .fetch-deps \ && rm -rf /usr/src/python CMD ["python2"] diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile index 0ee301e5b..34422813f 100644 --- a/2.7/wheezy/Dockerfile +++ b/2.7/wheezy/Dockerfile @@ -8,18 +8,19 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key 18ADD4FF: public key "Benjamin Peterson " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF +ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.11 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ && cd /usr/src/python \ diff --git a/3.2/Dockerfile b/3.2/Dockerfile index c4b635d32..2ee8ba9b5 100644 --- a/3.2/Dockerfile +++ b/3.2/Dockerfile @@ -8,20 +8,23 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.2.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.2/slim/Dockerfile b/3.2/slim/Dockerfile index ecc9ea86b..e00e1e7e9 100644 --- a/3.2/slim/Dockerfile +++ b/3.2/slim/Dockerfile @@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.2.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ +RUN set -ex \ && buildDeps=' \ curl \ gcc \ @@ -36,12 +36,15 @@ RUN set -x \ zlib1g-dev \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.2/wheezy/Dockerfile b/3.2/wheezy/Dockerfile index 70d24bcd9..76ace4329 100644 --- a/3.2/wheezy/Dockerfile +++ b/3.2/wheezy/Dockerfile @@ -8,18 +8,19 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.2.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ && cd /usr/src/python \ diff --git a/3.3/Dockerfile b/3.3/Dockerfile index c1ece663d..360cbd266 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -8,20 +8,23 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.3.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.3/alpine/Dockerfile b/3.3/alpine/Dockerfile new file mode 100644 index 000000000..03bf98d8d --- /dev/null +++ b/3.3/alpine/Dockerfile @@ -0,0 +1,67 @@ +FROM alpine:3.3 + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 + +ENV PYTHON_VERSION 3.3.6 + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 7.1.2 + +RUN set -ex \ + && apk add --no-cache --virtual .fetch-deps curl gnupg \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ + && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src \ + && tar -xJC /usr/src -f python.tar.xz \ + && mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \ + && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + gcc \ + libc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + zlib-dev \ + && cd /usr/src/python \ + && ./configure --enable-shared --enable-unicode=ucs4 \ + && make -j$(getconf _NPROCESSORS_ONLN) \ + && make install \ + && curl -fSL 'https://bootstrap.pypa.io/get-pip.py' | python3 \ + && pip install --no-cache-dir --upgrade pip==$PYTHON_PIP_VERSION \ + && find /usr/local \ + \( -type d -a -name test -o -name tests \) \ + -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + -exec rm -rf '{}' + \ + && runDeps="$( \ + scanelf --needed --nobanner --recursive /usr/local \ + | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ + | sort -u \ + | xargs -r apk info --installed \ + | sort -u \ + )" \ + && apk add --virtual .python-rundeps $runDeps \ + && apk del .build-deps .fetch-deps \ + && rm -rf /usr/src/python + +# make some useful symlinks that are expected to exist +RUN cd /usr/local/bin \ + && ln -s idle3 idle \ + && ln -s pydoc3 pydoc \ + && ln -s python3 python \ + && ln -s python-config3 python-config + +CMD ["python3"] diff --git a/3.3/slim/Dockerfile b/3.3/slim/Dockerfile index 295b7f7ff..39ccdfd3f 100644 --- a/3.3/slim/Dockerfile +++ b/3.3/slim/Dockerfile @@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.3.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ +RUN set -ex \ && buildDeps=' \ curl \ gcc \ @@ -36,12 +36,15 @@ RUN set -x \ zlib1g-dev \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.3/wheezy/Dockerfile b/3.3/wheezy/Dockerfile index 1a4f35c0a..7b46a12b5 100644 --- a/3.3/wheezy/Dockerfile +++ b/3.3/wheezy/Dockerfile @@ -8,20 +8,23 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key 36580288: public key "Georg Brandl (Python release signing key) " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288 +ENV GPG_KEY 26DEA9D4613391EF3E25C9FF0A5B101836580288 ENV PYTHON_VERSION 3.3.6 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 9f8990dea..5a759e538 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -8,20 +8,23 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key F73C700D: public key "Larry Hastings " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.4 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.4/alpine/Dockerfile b/3.4/alpine/Dockerfile new file mode 100644 index 000000000..4e85439f0 --- /dev/null +++ b/3.4/alpine/Dockerfile @@ -0,0 +1,68 @@ +FROM alpine:3.3 + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# gpg: key F73C700D: public key "Larry Hastings " imported +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D + +ENV PYTHON_VERSION 3.4.4 + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 7.1.2 + +RUN set -ex \ + && apk add --no-cache --virtual .fetch-deps curl gnupg \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ + && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src \ + && tar -xJC /usr/src -f python.tar.xz \ + && mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \ + && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + && apk del .fetch-deps \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + gcc \ + libc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + zlib-dev \ + && cd /usr/src/python \ + && ./configure --enable-shared --enable-unicode=ucs4 \ + && make -j$(getconf _NPROCESSORS_ONLN) \ + && make install \ + && pip3 install --no-cache-dir --upgrade --ignore-installed pip==$PYTHON_PIP_VERSION \ + && find /usr/local \ + \( -type d -a -name test -o -name tests \) \ + -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + -exec rm -rf '{}' + \ + && runDeps="$( \ + scanelf --needed --nobanner --recursive /usr/local \ + | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ + | sort -u \ + | xargs -r apk info --installed \ + | sort -u \ + )" \ + && apk add --virtual .python-rundeps $runDeps \ + && apk del .build-deps \ + && rm -rf /usr/src/python + +# make some useful symlinks that are expected to exist +RUN cd /usr/local/bin \ + && ln -s easy_install-3.4 easy_install \ + && ln -s idle3 idle \ + && ln -s pydoc3 pydoc \ + && ln -s python3 python \ + && ln -s python-config3 python-config + +CMD ["python3"] diff --git a/3.4/slim/Dockerfile b/3.4/slim/Dockerfile index f6622272d..9c051ce71 100644 --- a/3.4/slim/Dockerfile +++ b/3.4/slim/Dockerfile @@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # gpg: key F73C700D: public key "Larry Hastings " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.4 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ +RUN set -ex \ && buildDeps=' \ curl \ gcc \ @@ -36,12 +36,15 @@ RUN set -x \ zlib1g-dev \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index 132416051..83be7b643 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -8,20 +8,23 @@ RUN apt-get purge -y python.* ENV LANG C.UTF-8 # gpg: key F73C700D: public key "Larry Hastings " imported -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.4 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 7.1.2 -RUN set -x \ - && mkdir -p /usr/src/python \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ - && curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ +RUN set -ex \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \ + && curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \ && gpg --verify python.tar.xz.asc \ + && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ && rm python.tar.xz* \ + && rm -r ~/.gnupg \ + \ && cd /usr/src/python \ && ./configure --enable-shared --enable-unicode=ucs4 \ && make -j$(nproc) \ diff --git a/update.sh b/update.sh index 90f41b2aa..78cded699 100755 --- a/update.sh +++ b/update.sh @@ -11,6 +11,7 @@ versions=( "${versions[@]%/}" ) pipVersion="$(curl -fsSL 'https://pypi.python.org/pypi/pip/json' | awk -F '"' '$2 == "version" { print $4 }')" +travisEnv= for version in "${versions[@]}"; do # Python 2.7.8 # Python 3.4.1 @@ -28,4 +29,12 @@ for version in "${versions[@]}"; do ' "$version"/{,*/}Dockerfile sed -ri 's/^(FROM python):.*/\1:'"$version"'/' "$version/onbuild/Dockerfile" ) + for variant in wheezy alpine slim; do + [ -d "$version/$variant" ] || continue + travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv" + done + travisEnv='\n - VERSION='"$version VARIANT=$travisEnv" done + +travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)" +echo "$travis" > .travis.yml