diff --git a/.travis.yml b/.travis.yml index bd19be429..eea291395 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,27 +4,34 @@ services: docker env: - VERSION=3.7 VARIANT=stretch - VERSION=3.7 VARIANT=stretch/slim + - VERSION=3.7 VARIANT=alpine3.8 - VERSION=3.7 VARIANT=alpine3.7 - VERSION=3.6 VARIANT=stretch - VERSION=3.6 VARIANT=stretch/slim - VERSION=3.6 VARIANT=jessie - VERSION=3.6 VARIANT=jessie/slim + - VERSION=3.6 VARIANT=alpine3.8 - VERSION=3.6 VARIANT=alpine3.7 - VERSION=3.6 VARIANT=alpine3.6 - VERSION=3.5 VARIANT=stretch - VERSION=3.5 VARIANT=stretch/slim - VERSION=3.5 VARIANT=jessie - VERSION=3.5 VARIANT=jessie/slim + - VERSION=3.5 VARIANT=alpine3.8 - VERSION=3.5 VARIANT=alpine3.7 + - VERSION=3.4 VARIANT=stretch + - VERSION=3.4 VARIANT=stretch/slim - VERSION=3.4 VARIANT=jessie - VERSION=3.4 VARIANT=jessie/slim - VERSION=3.4 VARIANT=wheezy + - VERSION=3.4 VARIANT=alpine3.8 - VERSION=3.4 VARIANT=alpine3.7 - VERSION=2.7 VARIANT=stretch - VERSION=2.7 VARIANT=stretch/slim - VERSION=2.7 VARIANT=jessie - VERSION=2.7 VARIANT=jessie/slim - VERSION=2.7 VARIANT=wheezy + - VERSION=2.7 VARIANT=alpine3.8 - VERSION=2.7 VARIANT=alpine3.7 - VERSION=2.7 VARIANT=alpine3.6 @@ -33,6 +40,7 @@ install: before_script: - env | sort + - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash - cd "$VERSION/$VARIANT" - slash='/'; image="python:${VERSION}-${VARIANT//$slash/-}" @@ -41,7 +49,7 @@ script: ( set -Eeuo pipefail set -x - travis_retry docker build -t "$image" . + docker build -t "$image" . ~/official-images/test/run.sh "$image" if [ -d onbuild ]; then onbuildFrom="$(awk 'toupper($1) == "FROM" { print $2; exit }' onbuild/Dockerfile)" diff --git a/2.7/alpine3.6/Dockerfile b/2.7/alpine3.6/Dockerfile index 2d86a83d7..69be9e2fe 100644 --- a/2.7/alpine3.6/Dockerfile +++ b/2.7/alpine3.6/Dockerfile @@ -37,6 +37,7 @@ RUN set -ex \ bzip2-dev \ coreutils \ dpkg-dev dpkg \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -67,13 +68,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -82,7 +81,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 10.0.1 diff --git a/2.7/alpine3.7/Dockerfile b/2.7/alpine3.7/Dockerfile index a8aedd2a6..55523216c 100644 --- a/2.7/alpine3.7/Dockerfile +++ b/2.7/alpine3.7/Dockerfile @@ -37,6 +37,7 @@ RUN set -ex \ bzip2-dev \ coreutils \ dpkg-dev dpkg \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -69,13 +70,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -84,7 +83,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 10.0.1 diff --git a/2.7/alpine3.8/Dockerfile b/2.7/alpine3.8/Dockerfile new file mode 100644 index 000000000..36ff9623a --- /dev/null +++ b/2.7/alpine3.8/Dockerfile @@ -0,0 +1,116 @@ +FROM alpine:3.8 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 +# 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 \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && rm -rf "$GNUPGHOME" 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 \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libnsl-dev \ + libressl \ + libressl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-shared \ + --enable-unicode=ucs4 \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python2 --version + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +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 \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python2"] diff --git a/2.7/jessie/Dockerfile b/2.7/jessie/Dockerfile index 6c5df205d..122847bd4 100644 --- a/2.7/jessie/Dockerfile +++ b/2.7/jessie/Dockerfile @@ -9,21 +9,15 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ @@ -45,10 +39,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/2.7/jessie/slim/Dockerfile b/2.7/jessie/slim/Dockerfile index b3e13d4a7..affe7c077 100644 --- a/2.7/jessie/slim/Dockerfile +++ b/2.7/jessie/slim/Dockerfile @@ -12,10 +12,6 @@ ENV PYTHONIOENCODING UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libgdbm3 \ - libreadline6 \ - libsqlite3-0 \ - libssl1.0.0 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -23,6 +19,7 @@ ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -36,7 +33,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -67,6 +63,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/2.7/stretch/Dockerfile b/2.7/stretch/Dockerfile index 822c4cff5..8797f80cd 100644 --- a/2.7/stretch/Dockerfile +++ b/2.7/stretch/Dockerfile @@ -9,21 +9,15 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ @@ -45,10 +39,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/2.7/stretch/slim/Dockerfile b/2.7/stretch/slim/Dockerfile index 22418131a..ddc787608 100644 --- a/2.7/stretch/slim/Dockerfile +++ b/2.7/stretch/slim/Dockerfile @@ -23,6 +23,7 @@ ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -36,7 +37,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -67,6 +67,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile index c3dcaa10d..2b5f6a7c5 100644 --- a/2.7/wheezy/Dockerfile +++ b/2.7/wheezy/Dockerfile @@ -9,21 +9,15 @@ ENV LANG C.UTF-8 # https://github.com/docker-library/python/issues/147 ENV PYTHONIOENCODING UTF-8 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF ENV PYTHON_VERSION 2.7.15 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ @@ -45,10 +39,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.4/alpine3.7/Dockerfile b/3.4/alpine3.7/Dockerfile index eed4994f9..33a0e9f3b 100644 --- a/3.4/alpine3.7/Dockerfile +++ b/3.4/alpine3.7/Dockerfile @@ -32,6 +32,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -42,6 +43,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +79,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -92,7 +92,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/alpine3.8/Dockerfile b/3.4/alpine3.8/Dockerfile new file mode 100644 index 000000000..bde74d570 --- /dev/null +++ b/3.4/alpine3.8/Dockerfile @@ -0,0 +1,132 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.8 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# 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 \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + expat-dev \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libressl \ + libressl-dev \ + linux-headers \ + make \ + ncurses-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + xz-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +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 \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.4/jessie/Dockerfile b/3.4/jessie/Dockerfile index 19ca197b9..3c9d37ba5 100644 --- a/3.4/jessie/Dockerfile +++ b/3.4/jessie/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.4/jessie/slim/Dockerfile b/3.4/jessie/slim/Dockerfile index 9d93a8c52..701bb976c 100644 --- a/3.4/jessie/slim/Dockerfile +++ b/3.4/jessie/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline6 \ - libsqlite3-0 \ - libssl1.0.0 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/3.4/stretch/Dockerfile b/3.4/stretch/Dockerfile new file mode 100644 index 000000000..8bf470aa9 --- /dev/null +++ b/3.4/stretch/Dockerfile @@ -0,0 +1,91 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:stretch + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# extra dependencies (over what buildpack-deps already includes) +RUN apt-get update && apt-get install -y --no-install-recommends \ +# Python 3.4 on Stretch+ needs to use an older version of "libssl1.0-dev" (these lines both get removed for every other combination) + libssl1.0-dev \ + tk-dev \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV PYTHON_VERSION 3.4.8 + +RUN set -ex \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ + && make install \ + && ldconfig \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +RUN set -ex; \ + \ + wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.4/stretch/slim/Dockerfile b/3.4/stretch/slim/Dockerfile new file mode 100644 index 000000000..3abb22d01 --- /dev/null +++ b/3.4/stretch/slim/Dockerfile @@ -0,0 +1,133 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:stretch-slim + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# runtime dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + netbase \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV PYTHON_VERSION 3.4.8 + +RUN set -ex \ + \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ + dpkg-dev \ + gcc \ + libbz2-dev \ + libc6-dev \ + libexpat1-dev \ + libffi-dev \ + libgdbm-dev \ + liblzma-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl1.0-dev \ + make \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev \ +# as of Stretch, "gpg" is no longer included by default + $(command -v gpg > /dev/null || echo 'gnupg dirmngr') \ + && rm -rf /var/lib/apt/lists/* \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ + && make install \ + && ldconfig \ + \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends wget; \ + rm -rf /var/lib/apt/lists/*; \ + \ + wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index d21739337..a9a73bc05 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.5/alpine3.7/Dockerfile b/3.5/alpine3.7/Dockerfile index b38c4027f..890fb2221 100644 --- a/3.5/alpine3.7/Dockerfile +++ b/3.5/alpine3.7/Dockerfile @@ -32,6 +32,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -42,6 +43,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +79,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -92,7 +92,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.5/alpine3.8/Dockerfile b/3.5/alpine3.8/Dockerfile new file mode 100644 index 000000000..5c1740844 --- /dev/null +++ b/3.5/alpine3.8/Dockerfile @@ -0,0 +1,132 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.8 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# 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 \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + expat-dev \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + openssl \ + openssl-dev \ + linux-headers \ + make \ + ncurses-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + xz-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +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 \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.5/jessie/Dockerfile b/3.5/jessie/Dockerfile index 70136c96e..551c4fe7d 100644 --- a/3.5/jessie/Dockerfile +++ b/3.5/jessie/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.5/jessie/slim/Dockerfile b/3.5/jessie/slim/Dockerfile index 028c328c7..94fee51d1 100644 --- a/3.5/jessie/slim/Dockerfile +++ b/3.5/jessie/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline6 \ - libsqlite3-0 \ - libssl1.0.0 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/3.5/stretch/Dockerfile b/3.5/stretch/Dockerfile index ef001282b..7728a18c5 100644 --- a/3.5/stretch/Dockerfile +++ b/3.5/stretch/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.5/stretch/slim/Dockerfile b/3.5/stretch/slim/Dockerfile index b24e530ea..19635b7c6 100644 --- a/3.5/stretch/slim/Dockerfile +++ b/3.5/stretch/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline7 \ - libsqlite3-0 \ - libssl1.1 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.5.5 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/3.6/alpine3.6/Dockerfile b/3.6/alpine3.6/Dockerfile index 6efbff7c2..10b284f12 100644 --- a/3.6/alpine3.6/Dockerfile +++ b/3.6/alpine3.6/Dockerfile @@ -32,6 +32,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -42,6 +43,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +79,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -92,7 +92,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.6/alpine3.7/Dockerfile b/3.6/alpine3.7/Dockerfile index e6ea57254..5e5a5673c 100644 --- a/3.6/alpine3.7/Dockerfile +++ b/3.6/alpine3.7/Dockerfile @@ -32,6 +32,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -42,6 +43,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -79,13 +81,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -94,7 +94,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.6/alpine3.8/Dockerfile b/3.6/alpine3.8/Dockerfile new file mode 100644 index 000000000..f8102fc62 --- /dev/null +++ b/3.6/alpine3.8/Dockerfile @@ -0,0 +1,134 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.8 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# 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 \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + expat-dev \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libressl \ + libressl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + xz-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +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 \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.6/jessie/Dockerfile b/3.6/jessie/Dockerfile index 460a9a226..0c879b281 100644 --- a/3.6/jessie/Dockerfile +++ b/3.6/jessie/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.6/jessie/slim/Dockerfile b/3.6/jessie/slim/Dockerfile index 1ade0e5a4..c98ab1794 100644 --- a/3.6/jessie/slim/Dockerfile +++ b/3.6/jessie/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline6 \ - libsqlite3-0 \ - libssl1.0.0 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/3.6/stretch/Dockerfile b/3.6/stretch/Dockerfile index 902f7677d..1ab411ced 100644 --- a/3.6/stretch/Dockerfile +++ b/3.6/stretch/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.6/stretch/slim/Dockerfile b/3.6/stretch/slim/Dockerfile index 4128b5079..3ebec0e18 100644 --- a/3.6/stretch/slim/Dockerfile +++ b/3.6/stretch/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline7 \ - libsqlite3-0 \ - libssl1.1 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.6.6 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/3.7/alpine3.7/Dockerfile b/3.7/alpine3.7/Dockerfile index e49f25221..ae881e7e6 100644 --- a/3.7/alpine3.7/Dockerfile +++ b/3.7/alpine3.7/Dockerfile @@ -32,6 +32,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -42,6 +43,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -79,13 +81,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -94,7 +94,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.7/alpine3.8/Dockerfile b/3.7/alpine3.8/Dockerfile new file mode 100644 index 000000000..e7a96d6ed --- /dev/null +++ b/3.7/alpine3.8/Dockerfile @@ -0,0 +1,134 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.8 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# 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 + +# 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 \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" 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 \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + expat-dev \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libressl \ + libressl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + xz-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# 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 python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 10.0.1 + +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 \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.7/stretch/Dockerfile b/3.7/stretch/Dockerfile index fa5173ea7..b49129fe3 100644 --- a/3.7/stretch/Dockerfile +++ b/3.7/stretch/Dockerfile @@ -13,27 +13,22 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.0 RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -52,10 +47,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/3.7/stretch/slim/Dockerfile b/3.7/stretch/slim/Dockerfile index 5fe97aaf2..55d9c018a 100644 --- a/3.7/stretch/slim/Dockerfile +++ b/3.7/stretch/slim/Dockerfile @@ -16,12 +16,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline7 \ - libsqlite3-0 \ - libssl1.1 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -29,6 +23,7 @@ ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D ENV PYTHON_VERSION 3.7.0 RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -44,7 +39,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -58,6 +52,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -78,6 +73,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 2f7bb8691..8e9400c9f 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -26,6 +26,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -36,6 +37,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -73,13 +75,11 @@ RUN set -ex \ EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ && make install \ \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .python-rundeps $runDeps \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --virtual .python-rundeps \ && apk del .build-deps \ \ && find /usr/local -depth \ @@ -88,7 +88,9 @@ RUN set -ex \ -o \ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ \) -exec rm -rf '{}' + \ - && rm -rf /usr/src/python + && rm -rf /usr/src/python \ + \ + && python3 --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index d747aebe0..293ec8acc 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -7,27 +7,24 @@ 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 -# runtime dependencies +# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ - tcl \ - tk \ +# Python 3.4 on Stretch+ needs to use an older version of "libssl-dev" (these lines both get removed for every other combination) + libssl-dev \ + tk-dev \ && rm -rf /var/lib/apt/lists/* ENV GPG_KEY %%PLACEHOLDER%% ENV PYTHON_VERSION %%PLACEHOLDER%% RUN set -ex \ - && savedAptMark="$(apt-mark showmanual)" \ - && apt-get update && apt-get install -y --no-install-recommends \ - tcl-dev \ - tk-dev \ - && rm -rf /var/lib/apt/lists/* \ \ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -46,10 +43,6 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-mark auto '.*' > /dev/null \ - && apt-mark manual $savedAptMark \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - \ && find /usr/local -depth \ \( \ \( -type d -a \( -name test -o -name tests \) \) \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 7f35972a3..4d9f8b648 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -10,12 +10,6 @@ ENV LANG C.UTF-8 # runtime dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ - libexpat1 \ - libffi6 \ - libgdbm3 \ - libreadline7 \ - libsqlite3-0 \ - libssl1.1 \ netbase \ && rm -rf /var/lib/apt/lists/* @@ -23,6 +17,7 @@ ENV GPG_KEY %%PLACEHOLDER%% ENV PYTHON_VERSION %%PLACEHOLDER%% RUN set -ex \ + \ && savedAptMark="$(apt-mark showmanual)" \ && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ @@ -38,7 +33,6 @@ RUN set -ex \ libsqlite3-dev \ libssl-dev \ make \ - tcl-dev \ tk-dev \ wget \ xz-utils \ @@ -52,6 +46,7 @@ RUN set -ex \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ @@ -72,6 +67,13 @@ RUN set -ex \ \ && apt-mark auto '.*' > /dev/null \ && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ \ && find /usr/local -depth \ diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index b7fbf96be..dc7017de3 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -77,7 +77,7 @@ for version in "${versions[@]}"; do for v in \ {stretch,jessie,wheezy}{,/slim,/onbuild} \ - alpine{3.7,3.6} \ + alpine{3.8,3.7,3.6} \ windows/windowsservercore-{ltsc2016,1709} \ windows/nanoserver-{sac2016,1709} \ ; do diff --git a/update.sh b/update.sh index 3e76d862f..7f4616ccc 100755 --- a/update.sh +++ b/update.sh @@ -112,7 +112,7 @@ for version in "${versions[@]}"; do echo "$version: $fullVersion" for v in \ - alpine{3.6,3.7} \ + alpine{3.6,3.7,3.8} \ {wheezy,jessie,stretch}{/slim,/onbuild,} \ windows/nanoserver-{1709,sac2016} \ windows/windowsservercore-{1709,ltsc2016} \ @@ -161,25 +161,24 @@ for version in "${versions[@]}"; do wheezy) sed -ri -e 's/dpkg-architecture --query /dpkg-architecture -q/g' "$dir/Dockerfile" ;; esac - # https://bugs.python.org/issue32598 (Python 3.7.0b1+) - # TL;DR: Python 3.7+ uses OpenSSL functionality which LibreSSL doesn't implement (yet?) - if [[ "$version" == 3.7* ]] && [[ "$variant" == alpine* ]]; then - sed -ri -e 's/libressl/openssl/g' "$dir/Dockerfile" - fi - - # 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+. - if [[ "$variant" == alpine* ]] && [[ "$version" == 3.4* || "$version" == 3.5* ]] \ - || [[ "$variant" == alpine3.6 ]]; then - sed -ri -e '/libnsl-dev/d' -e '/libtirpc-dev/d' "$dir/Dockerfile" - fi - - case "$v" in - wheezy/slim|jessie/slim) - sed -ri \ - -e 's/libssl1.1/libssl1.0.0/g' \ - -e 's/libreadline7/libreadline6/g' \ - "$dir/Dockerfile" + 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" + ;;& # (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+. + 3.4*/alpine* | 3.5*/alpine* | */alpine3.6) + sed -ri -e '/libnsl-dev/d' -e '/libtirpc-dev/d' "$dir/Dockerfile" + ;; + 3.4/stretch*) + sed -ri -e 's/libssl-dev/libssl1.0-dev/g' "$dir/Dockerfile" + ;; + */slim) ;; + */stretch | */jessie | */wheezy) + sed -ri -e '/libssl-dev/d' "$dir/Dockerfile" ;; esac