diff --git a/2.7/alpine3.6/Dockerfile b/2.7/alpine3.6/Dockerfile index 290833b62..a1b991e42 100644 --- a/2.7/alpine3.6/Dockerfile +++ b/2.7/alpine3.6/Dockerfile @@ -15,8 +15,7 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later +# install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base) RUN apk add --no-cache ca-certificates ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF @@ -97,12 +96,10 @@ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ \ - apk add --no-cache --virtual .fetch-deps libressl; \ + apk add --no-cache --virtual .fetch-deps libressl; trap 'apk del .fetch-deps' EXIT; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/2.7/alpine3.7/Dockerfile b/2.7/alpine3.7/Dockerfile index a2379cff1..b4517f0b2 100644 --- a/2.7/alpine3.7/Dockerfile +++ b/2.7/alpine3.7/Dockerfile @@ -15,17 +15,12 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libnsl-dev \ - libressl \ libressl-dev \ libtirpc-dev \ linux-headers \ @@ -98,13 +92,9 @@ RUN set -ex \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/2.7/alpine3.8/Dockerfile b/2.7/alpine3.8/Dockerfile index a2d9f31b3..98344875a 100644 --- a/2.7/alpine3.8/Dockerfile +++ b/2.7/alpine3.8/Dockerfile @@ -15,17 +15,12 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libnsl-dev \ - libressl \ libressl-dev \ libtirpc-dev \ linux-headers \ @@ -98,13 +92,9 @@ RUN set -ex \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.4/alpine3.7/Dockerfile b/3.4/alpine3.7/Dockerfile index e5fdc190e..858ce8980 100644 --- a/3.4/alpine3.7/Dockerfile +++ b/3.4/alpine3.7/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -48,7 +43,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libffi-dev \ - libressl \ libressl-dev \ linux-headers \ make \ @@ -107,13 +101,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.4/alpine3.8/Dockerfile b/3.4/alpine3.8/Dockerfile index 42f613c65..4fcdd4a4b 100644 --- a/3.4/alpine3.8/Dockerfile +++ b/3.4/alpine3.8/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -48,7 +43,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libffi-dev \ - libressl \ libressl-dev \ linux-headers \ make \ @@ -107,13 +101,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.5/alpine3.7/Dockerfile b/3.5/alpine3.7/Dockerfile index 77879ecf0..cf0b62c1f 100644 --- a/3.5/alpine3.7/Dockerfile +++ b/3.5/alpine3.7/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -48,7 +43,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libffi-dev \ - libressl \ libressl-dev \ linux-headers \ make \ @@ -107,13 +101,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.5/alpine3.8/Dockerfile b/3.5/alpine3.8/Dockerfile index 0eeda4f1f..088071042 100644 --- a/3.5/alpine3.8/Dockerfile +++ b/3.5/alpine3.8/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - openssl \ tar \ xz \ \ @@ -48,7 +43,6 @@ RUN set -ex \ gdbm-dev \ libc-dev \ libffi-dev \ - openssl \ openssl-dev \ linux-headers \ make \ @@ -107,13 +101,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps openssl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.6/alpine3.6/Dockerfile b/3.6/alpine3.6/Dockerfile index cf4a1cd66..bceec9d46 100644 --- a/3.6/alpine3.6/Dockerfile +++ b/3.6/alpine3.6/Dockerfile @@ -13,8 +13,7 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later +# install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base) RUN apk add --no-cache ca-certificates ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D @@ -108,12 +107,10 @@ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ \ - apk add --no-cache --virtual .fetch-deps libressl; \ + apk add --no-cache --virtual .fetch-deps libressl; trap 'apk del .fetch-deps' EXIT; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.6/alpine3.7/Dockerfile b/3.6/alpine3.7/Dockerfile index 6af00750a..a3d433ce6 100644 --- a/3.6/alpine3.7/Dockerfile +++ b/3.6/alpine3.7/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ libc-dev \ libffi-dev \ libnsl-dev \ - libressl \ libressl-dev \ libtirpc-dev \ linux-headers \ @@ -109,13 +103,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.6/alpine3.8/Dockerfile b/3.6/alpine3.8/Dockerfile index 89b97ccbb..b2e81be6d 100644 --- a/3.6/alpine3.8/Dockerfile +++ b/3.6/alpine3.8/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ libc-dev \ libffi-dev \ libnsl-dev \ - libressl \ libressl-dev \ libtirpc-dev \ linux-headers \ @@ -109,13 +103,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.7/alpine3.7/Dockerfile b/3.7/alpine3.7/Dockerfile index 4e24dc545..83371a0b6 100644 --- a/3.7/alpine3.7/Dockerfile +++ b/3.7/alpine3.7/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.0 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - openssl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ libc-dev \ libffi-dev \ libnsl-dev \ - openssl \ openssl-dev \ libtirpc-dev \ linux-headers \ @@ -109,13 +103,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps openssl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/3.7/alpine3.8/Dockerfile b/3.7/alpine3.8/Dockerfile index 6b9fe4698..26aaacb07 100644 --- a/3.7/alpine3.8/Dockerfile +++ b/3.7/alpine3.8/Dockerfile @@ -13,17 +13,12 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later -RUN apk add --no-cache ca-certificates - ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.0 RUN set -ex \ && apk add --no-cache --virtual .fetch-deps \ gnupg \ - libressl \ tar \ xz \ \ @@ -49,7 +44,6 @@ RUN set -ex \ libc-dev \ libffi-dev \ libnsl-dev \ - libressl \ libressl-dev \ libtirpc-dev \ linux-headers \ @@ -109,13 +103,9 @@ RUN cd /usr/local/bin \ ENV PYTHON_PIP_VERSION 18.0 RUN set -ex; \ - \ - apk add --no-cache --virtual .fetch-deps libressl; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 8e9400c9f..43c2df0d8 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -7,8 +7,7 @@ ENV PATH /usr/local/bin:$PATH # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later +# install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base) RUN apk add --no-cache ca-certificates ENV GPG_KEY %%PLACEHOLDER%% @@ -104,12 +103,10 @@ ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% RUN set -ex; \ \ - apk add --no-cache --virtual .fetch-deps libressl; \ + apk add --no-cache --virtual .fetch-deps libressl; trap 'apk del .fetch-deps' EXIT; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/Dockerfile-caveman-alpine.template b/Dockerfile-caveman-alpine.template index ef9107741..3ca746fe6 100644 --- a/Dockerfile-caveman-alpine.template +++ b/Dockerfile-caveman-alpine.template @@ -9,8 +9,7 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# install ca-certificates so that HTTPS works consistently -# the other runtime dependencies for Python are installed later +# install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base) RUN apk add --no-cache ca-certificates ENV GPG_KEY %%PLACEHOLDER%% @@ -93,12 +92,10 @@ ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% RUN set -ex; \ \ - apk add --no-cache --virtual .fetch-deps libressl; \ + apk add --no-cache --virtual .fetch-deps libressl; trap 'apk del .fetch-deps' EXIT; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ \ - apk del .fetch-deps; \ - \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ diff --git a/update.sh b/update.sh index de7ca42fb..3fd81c600 100755 --- a/update.sh +++ b/update.sh @@ -152,12 +152,22 @@ for version in "${versions[@]}"; do wheezy) sed -ri -e 's/dpkg-architecture --query /dpkg-architecture -q/g' "$dir/Dockerfile" ;; esac + if [[ "$v" == alpine* ]] && [ "$v" != 'alpine3.6' ]; then + # https://github.com/docker-library/python/pull/307 + # on Alpine 3.6 it's necessary to install libressl to get working HTTPS with wget (and ca-certificates for Python's runtime), but later versions don't require this (support for both is baked into the base) + sed -ri -e '/(libressl|openssl|ca-certificates)([ ;]|$)/d' "$dir/Dockerfile" + + # remove any double-empty (or double-empty-continuation) lines the above created + uniq "$dir/Dockerfile" > "$dir/Dockerfile.new" + mv "$dir/Dockerfile.new" "$dir/Dockerfile" + fi + case "$version/$v" in # https://bugs.python.org/issue32598 (Python 3.7.0b1+) # TL;DR: Python 3.7+ uses OpenSSL functionality which LibreSSL 2.6.x in Alpine 3.7 doesn't implement # Python 3.5 on Alpine 3.8 needs OpenSSL too 3.7*/alpine3.7 | 3.5*/alpine3.8) - sed -ri -e 's/libressl/openssl/g' "$dir/Dockerfile" + sed -ri -e 's/libressl-dev/openssl-dev/g' "$dir/Dockerfile" ;;& # (3.5*/alpine* needs to match the next block too) # Libraries to build the nis module only available in Alpine 3.7+. # Also require this patch https://bugs.python.org/issue32521 only available in Python 2.7, 3.6+.