From 19f8c873f97ae0f69009aa293d019b2bf3e5aa13 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Fri, 13 Jul 2018 09:00:48 +1000 Subject: [PATCH 1/6] Add stretch to v3.4 For Context OpenStack needs to test multiple python versions 2.7 and 3.4+ Adding stretcg based 3.4 containers makes this possible without adding the overhead of multiple debian versions. --- .travis.yml | 2 + 3.4/stretch/Dockerfile | 95 +++++++++++++++++++++++++ 3.4/stretch/onbuild/Dockerfile | 15 ++++ 3.4/stretch/slim/Dockerfile | 124 +++++++++++++++++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 3.4/stretch/Dockerfile create mode 100644 3.4/stretch/onbuild/Dockerfile create mode 100644 3.4/stretch/slim/Dockerfile diff --git a/.travis.yml b/.travis.yml index bd19be429..49fb1751f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ env: - VERSION=3.5 VARIANT=jessie - VERSION=3.5 VARIANT=jessie/slim - 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 diff --git a/3.4/stretch/Dockerfile b/3.4/stretch/Dockerfile new file mode 100644 index 000000000..0628cdb84 --- /dev/null +++ b/3.4/stretch/Dockerfile @@ -0,0 +1,95 @@ +# +# 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 + +# runtime dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + tcl \ + tk \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV PYTHON_VERSION 3.4.8 + +RUN set -ex \ + && buildDeps=' \ + dpkg-dev \ + tcl-dev \ + tk-dev \ + ' \ + && apt-get update && apt-get install -y $buildDeps --no-install-recommends && 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 \ + && 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-get purge -y --auto-remove $buildDeps \ + \ + && 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 + +# 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/onbuild/Dockerfile b/3.4/stretch/onbuild/Dockerfile new file mode 100644 index 000000000..8edf952c0 --- /dev/null +++ b/3.4/stretch/onbuild/Dockerfile @@ -0,0 +1,15 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM python:3.4-stretch + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +ONBUILD COPY requirements.txt /usr/src/app/ +ONBUILD RUN pip install --no-cache-dir -r requirements.txt + +ONBUILD COPY . /usr/src/app diff --git a/3.4/stretch/slim/Dockerfile b/3.4/stretch/slim/Dockerfile new file mode 100644 index 000000000..e01fa6351 --- /dev/null +++ b/3.4/stretch/slim/Dockerfile @@ -0,0 +1,124 @@ +# +# 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 \ + libexpat1 \ + libffi6 \ + libgdbm3 \ + libreadline7 \ + libsqlite3-0 \ + libssl1.1 \ + netbase \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D +ENV PYTHON_VERSION 3.4.8 + +RUN set -ex \ + && buildDeps=" \ + dpkg-dev \ + gcc \ + libbz2-dev \ + libc6-dev \ + libexpat1-dev \ + libffi-dev \ + libgdbm-dev \ + liblzma-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + make \ + tcl-dev \ + 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') \ + " \ + && apt-get update && apt-get install -y $buildDeps --no-install-recommends && 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 \ + && 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-get purge -y --auto-remove $buildDeps \ + \ + && 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 + +# 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; \ + \ + 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-get purge -y --auto-remove wget; \ + \ + 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"] From 375a7823c5f5577439eccfd16e9c741c902b7584 Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Fri, 6 Jul 2018 16:35:39 +0800 Subject: [PATCH 2/6] Add 3.7/alpine3.8 --- .travis.yml | 1 + 3.7/alpine3.8/Dockerfile | 132 +++++++++++++++++++++++++++++++++++++++ update.sh | 6 +- 3 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 3.7/alpine3.8/Dockerfile diff --git a/.travis.yml b/.travis.yml index 49fb1751f..7655a5dcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ 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 diff --git a/3.7/alpine3.8/Dockerfile b/3.7/alpine3.8/Dockerfile new file mode 100644 index 000000000..f53793fec --- /dev/null +++ b/3.7/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 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 \ + && 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 \ + 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 \ + \ + && 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 \ + && 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 + +# 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/update.sh b/update.sh index 3e76d862f..a15bdecbe 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} \ @@ -162,8 +162,8 @@ for version in "${versions[@]}"; do 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 + # TL;DR: Python 3.7+ uses OpenSSL functionality which LibreSSL 2.6.x in Alpine 3.7 doesn't implement + if [[ "$version" == 3.7* ]] && [[ "$variant" == alpine3.7 ]]; then sed -ri -e 's/libressl/openssl/g' "$dir/Dockerfile" fi From c7fd135e4c226dcfacfca6ba75591d06a8f5003e Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Sat, 7 Jul 2018 14:30:10 +0800 Subject: [PATCH 3/6] Add 2.7/alpine3.8 --- .travis.yml | 1 + 2.7/alpine3.8/Dockerfile | 115 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 2.7/alpine3.8/Dockerfile diff --git a/.travis.yml b/.travis.yml index 7655a5dcc..376144939 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ env: - 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 diff --git a/2.7/alpine3.8/Dockerfile b/2.7/alpine3.8/Dockerfile new file mode 100644 index 000000000..e91485f2e --- /dev/null +++ b/2.7/alpine3.8/Dockerfile @@ -0,0 +1,115 @@ +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 \ + 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 \ + \ + && 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 \ + && 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 + +# 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"] From a70575c01b81fe9c8d920e13a03f55bdc0622328 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 13 Jul 2018 11:58:21 -0700 Subject: [PATCH 4/6] Refactor dependencies handling to keep necessary runtime dependencies automatically, accounting for "tkinter" and "libssl" edge cases appropriately --- 2.7/alpine3.6/Dockerfile | 17 ++++++++-------- 2.7/alpine3.7/Dockerfile | 17 ++++++++-------- 2.7/alpine3.8/Dockerfile | 17 ++++++++-------- 2.7/jessie/Dockerfile | 14 ++----------- 2.7/jessie/slim/Dockerfile | 13 +++++++----- 2.7/stretch/Dockerfile | 14 ++----------- 2.7/stretch/slim/Dockerfile | 9 ++++++++- 2.7/wheezy/Dockerfile | 14 ++----------- 3.4/alpine3.7/Dockerfile | 17 ++++++++-------- 3.4/jessie/Dockerfile | 14 ++----------- 3.4/jessie/slim/Dockerfile | 15 +++++++------- 3.4/stretch/Dockerfile | 19 +++++++----------- 3.4/stretch/onbuild/Dockerfile | 15 -------------- 3.4/stretch/slim/Dockerfile | 36 +++++++++++++++++++++------------- 3.4/wheezy/Dockerfile | 14 ++----------- 3.5/alpine3.7/Dockerfile | 17 ++++++++-------- 3.5/jessie/Dockerfile | 14 ++----------- 3.5/jessie/slim/Dockerfile | 15 +++++++------- 3.5/stretch/Dockerfile | 14 ++----------- 3.5/stretch/slim/Dockerfile | 15 +++++++------- 3.6/alpine3.6/Dockerfile | 17 ++++++++-------- 3.6/alpine3.7/Dockerfile | 17 ++++++++-------- 3.6/jessie/Dockerfile | 14 ++----------- 3.6/jessie/slim/Dockerfile | 15 +++++++------- 3.6/stretch/Dockerfile | 14 ++----------- 3.6/stretch/slim/Dockerfile | 15 +++++++------- 3.7/alpine3.7/Dockerfile | 17 ++++++++-------- 3.7/alpine3.8/Dockerfile | 17 ++++++++-------- 3.7/stretch/Dockerfile | 14 ++----------- 3.7/stretch/slim/Dockerfile | 15 +++++++------- Dockerfile-alpine.template | 17 ++++++++-------- Dockerfile-debian.template | 16 ++++----------- Dockerfile-slim.template | 15 +++++++------- generate-stackbrew-library.sh | 2 +- update.sh | 13 ++++++------ 35 files changed, 223 insertions(+), 315 deletions(-) delete mode 100644 3.4/stretch/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 index e91485f2e..36ff9623a 100644 --- a/2.7/alpine3.8/Dockerfile +++ b/2.7/alpine3.8/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/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..365f4b738 100644 --- a/3.4/alpine3.7/Dockerfile +++ b/3.4/alpine3.7/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +78,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 +91,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/jessie/Dockerfile b/3.4/jessie/Dockerfile index 19ca197b9..380aa905a 100644 --- a/3.4/jessie/Dockerfile +++ b/3.4/jessie/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..2177bed46 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 \ @@ -78,6 +72,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 index 0628cdb84..525e8c8fd 100644 --- a/3.4/stretch/Dockerfile +++ b/3.4/stretch/Dockerfile @@ -13,22 +13,17 @@ 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 "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 \ - && buildDeps=' \ - dpkg-dev \ - tcl-dev \ - tk-dev \ - ' \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && 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" \ @@ -53,15 +48,15 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-get purge -y --auto-remove $buildDeps \ - \ && 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 + && 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/stretch/onbuild/Dockerfile b/3.4/stretch/onbuild/Dockerfile deleted file mode 100644 index 8edf952c0..000000000 --- a/3.4/stretch/onbuild/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM python:3.4-stretch - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -ONBUILD COPY requirements.txt /usr/src/app/ -ONBUILD RUN pip install --no-cache-dir -r requirements.txt - -ONBUILD COPY . /usr/src/app diff --git a/3.4/stretch/slim/Dockerfile b/3.4/stretch/slim/Dockerfile index e01fa6351..aae09f7d1 100644 --- a/3.4/stretch/slim/Dockerfile +++ b/3.4/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,7 +23,9 @@ ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D ENV PYTHON_VERSION 3.4.8 RUN set -ex \ - && buildDeps=" \ + \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ dpkg-dev \ gcc \ libbz2-dev \ @@ -41,17 +37,15 @@ RUN set -ex \ libncursesw5-dev \ libreadline-dev \ libsqlite3-dev \ - libssl-dev \ + libssl1.0-dev \ make \ - tcl-dev \ 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') \ - " \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ + && 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" \ @@ -76,7 +70,16 @@ RUN set -ex \ && make install \ && ldconfig \ \ - && apt-get purge -y --auto-remove $buildDeps \ + && 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 \ \( \ @@ -84,7 +87,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 \ @@ -98,13 +103,16 @@ 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-get purge -y --auto-remove wget; \ + 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 \ diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index d21739337..03186cb53 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..0fcaf45b5 100644 --- a/3.5/alpine3.7/Dockerfile +++ b/3.5/alpine3.7/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +78,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 +91,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/jessie/Dockerfile b/3.5/jessie/Dockerfile index 70136c96e..3da591b24 100644 --- a/3.5/jessie/Dockerfile +++ b/3.5/jessie/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..5533eddf1 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 \ @@ -78,6 +72,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..ac21c0ff2 100644 --- a/3.5/stretch/Dockerfile +++ b/3.5/stretch/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..cdede1528 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 \ @@ -78,6 +72,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..4ca136eb9 100644 --- a/3.6/alpine3.6/Dockerfile +++ b/3.6/alpine3.6/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -77,13 +78,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 +91,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..3da23aad5 100644 --- a/3.6/alpine3.7/Dockerfile +++ b/3.6/alpine3.7/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -79,13 +80,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 +93,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/jessie/Dockerfile b/3.6/jessie/Dockerfile index 460a9a226..85fa32af9 100644 --- a/3.6/jessie/Dockerfile +++ b/3.6/jessie/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..8d9f873d6 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 \ @@ -78,6 +72,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..b573a2670 100644 --- a/3.6/stretch/Dockerfile +++ b/3.6/stretch/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..65da86d6c 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 \ @@ -78,6 +72,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..ed7485f62 100644 --- a/3.7/alpine3.7/Dockerfile +++ b/3.7/alpine3.7/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -79,13 +80,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 +93,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 index f53793fec..5180b2e06 100644 --- a/3.7/alpine3.8/Dockerfile +++ b/3.7/alpine3.8/Dockerfile @@ -42,6 +42,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -79,13 +80,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 +93,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/stretch/Dockerfile b/3.7/stretch/Dockerfile index fa5173ea7..6d20e0e47 100644 --- a/3.7/stretch/Dockerfile +++ b/3.7/stretch/Dockerfile @@ -13,21 +13,15 @@ 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" \ @@ -52,10 +46,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..f5ddb60b8 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 \ @@ -78,6 +72,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..78aac23ec 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -36,6 +36,7 @@ RUN set -ex \ coreutils \ dpkg-dev dpkg \ expat-dev \ + findutils \ gcc \ gdbm-dev \ libc-dev \ @@ -73,13 +74,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 +87,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..808797b63 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -7,21 +7,17 @@ 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" \ @@ -46,10 +42,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..32ce7a4a5 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 \ @@ -72,6 +66,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 a15bdecbe..83120aecb 100755 --- a/update.sh +++ b/update.sh @@ -174,12 +174,13 @@ for version in "${versions[@]}"; do 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 + 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 From 7a794688c7246e7eff898f5288716a3e7dc08484 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 13 Jul 2018 12:42:14 -0700 Subject: [PATCH 5/6] Add "pgp-happy-eyeballs" in Travis to help cut down on gpg-related issues Also, this removes the not-recommended usage of "travis_retry" and adds "gpgconf --kill all". --- .travis.yml | 3 ++- 3.4/alpine3.7/Dockerfile | 1 + 3.4/jessie/Dockerfile | 1 + 3.4/jessie/slim/Dockerfile | 1 + 3.4/stretch/Dockerfile | 1 + 3.4/stretch/slim/Dockerfile | 1 + 3.4/wheezy/Dockerfile | 1 + 3.5/alpine3.7/Dockerfile | 1 + 3.5/jessie/Dockerfile | 1 + 3.5/jessie/slim/Dockerfile | 1 + 3.5/stretch/Dockerfile | 1 + 3.5/stretch/slim/Dockerfile | 1 + 3.6/alpine3.6/Dockerfile | 1 + 3.6/alpine3.7/Dockerfile | 1 + 3.6/jessie/Dockerfile | 1 + 3.6/jessie/slim/Dockerfile | 1 + 3.6/stretch/Dockerfile | 1 + 3.6/stretch/slim/Dockerfile | 1 + 3.7/alpine3.7/Dockerfile | 1 + 3.7/alpine3.8/Dockerfile | 1 + 3.7/stretch/Dockerfile | 1 + 3.7/stretch/slim/Dockerfile | 1 + Dockerfile-alpine.template | 1 + Dockerfile-debian.template | 1 + Dockerfile-slim.template | 1 + 25 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 376144939..3354ef59b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,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/-}" @@ -45,7 +46,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/3.4/alpine3.7/Dockerfile b/3.4/alpine3.7/Dockerfile index 365f4b738..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 \ diff --git a/3.4/jessie/Dockerfile b/3.4/jessie/Dockerfile index 380aa905a..3c9d37ba5 100644 --- a/3.4/jessie/Dockerfile +++ b/3.4/jessie/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.4/jessie/slim/Dockerfile b/3.4/jessie/slim/Dockerfile index 2177bed46..701bb976c 100644 --- a/3.4/jessie/slim/Dockerfile +++ b/3.4/jessie/slim/Dockerfile @@ -52,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 \ diff --git a/3.4/stretch/Dockerfile b/3.4/stretch/Dockerfile index 525e8c8fd..8bf470aa9 100644 --- a/3.4/stretch/Dockerfile +++ b/3.4/stretch/Dockerfile @@ -30,6 +30,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 \ diff --git a/3.4/stretch/slim/Dockerfile b/3.4/stretch/slim/Dockerfile index aae09f7d1..3abb22d01 100644 --- a/3.4/stretch/slim/Dockerfile +++ b/3.4/stretch/slim/Dockerfile @@ -52,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 \ diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index 03186cb53..a9a73bc05 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.5/alpine3.7/Dockerfile b/3.5/alpine3.7/Dockerfile index 0fcaf45b5..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 \ diff --git a/3.5/jessie/Dockerfile b/3.5/jessie/Dockerfile index 3da591b24..551c4fe7d 100644 --- a/3.5/jessie/Dockerfile +++ b/3.5/jessie/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.5/jessie/slim/Dockerfile b/3.5/jessie/slim/Dockerfile index 5533eddf1..94fee51d1 100644 --- a/3.5/jessie/slim/Dockerfile +++ b/3.5/jessie/slim/Dockerfile @@ -52,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 \ diff --git a/3.5/stretch/Dockerfile b/3.5/stretch/Dockerfile index ac21c0ff2..7728a18c5 100644 --- a/3.5/stretch/Dockerfile +++ b/3.5/stretch/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.5/stretch/slim/Dockerfile b/3.5/stretch/slim/Dockerfile index cdede1528..19635b7c6 100644 --- a/3.5/stretch/slim/Dockerfile +++ b/3.5/stretch/slim/Dockerfile @@ -52,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 \ diff --git a/3.6/alpine3.6/Dockerfile b/3.6/alpine3.6/Dockerfile index 4ca136eb9..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 \ diff --git a/3.6/alpine3.7/Dockerfile b/3.6/alpine3.7/Dockerfile index 3da23aad5..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 \ diff --git a/3.6/jessie/Dockerfile b/3.6/jessie/Dockerfile index 85fa32af9..0c879b281 100644 --- a/3.6/jessie/Dockerfile +++ b/3.6/jessie/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.6/jessie/slim/Dockerfile b/3.6/jessie/slim/Dockerfile index 8d9f873d6..c98ab1794 100644 --- a/3.6/jessie/slim/Dockerfile +++ b/3.6/jessie/slim/Dockerfile @@ -52,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 \ diff --git a/3.6/stretch/Dockerfile b/3.6/stretch/Dockerfile index b573a2670..1ab411ced 100644 --- a/3.6/stretch/Dockerfile +++ b/3.6/stretch/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.6/stretch/slim/Dockerfile b/3.6/stretch/slim/Dockerfile index 65da86d6c..3ebec0e18 100644 --- a/3.6/stretch/slim/Dockerfile +++ b/3.6/stretch/slim/Dockerfile @@ -52,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 \ diff --git a/3.7/alpine3.7/Dockerfile b/3.7/alpine3.7/Dockerfile index ed7485f62..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 \ diff --git a/3.7/alpine3.8/Dockerfile b/3.7/alpine3.8/Dockerfile index 5180b2e06..e7a96d6ed 100644 --- a/3.7/alpine3.8/Dockerfile +++ b/3.7/alpine3.8/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 \ diff --git a/3.7/stretch/Dockerfile b/3.7/stretch/Dockerfile index 6d20e0e47..b49129fe3 100644 --- a/3.7/stretch/Dockerfile +++ b/3.7/stretch/Dockerfile @@ -28,6 +28,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 \ diff --git a/3.7/stretch/slim/Dockerfile b/3.7/stretch/slim/Dockerfile index f5ddb60b8..55d9c018a 100644 --- a/3.7/stretch/slim/Dockerfile +++ b/3.7/stretch/slim/Dockerfile @@ -52,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 \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 78aac23ec..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 \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 808797b63..293ec8acc 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -24,6 +24,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 \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 32ce7a4a5..4d9f8b648 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -46,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 \ From c24c7b5b7c77c99793c4cff488a81e8cb3cc7e61 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 13 Jul 2018 13:02:16 -0700 Subject: [PATCH 6/6] Add 3.6/alpine3.8, 3.5/alpine3.8, and 3.4/alpine3.8 --- .travis.yml | 3 + 3.4/alpine3.8/Dockerfile | 132 ++++++++++++++++++++++++++++++++++++++ 3.5/alpine3.8/Dockerfile | 132 ++++++++++++++++++++++++++++++++++++++ 3.6/alpine3.8/Dockerfile | 134 +++++++++++++++++++++++++++++++++++++++ update.sh | 24 ++++--- 5 files changed, 412 insertions(+), 13 deletions(-) create mode 100644 3.4/alpine3.8/Dockerfile create mode 100644 3.5/alpine3.8/Dockerfile create mode 100644 3.6/alpine3.8/Dockerfile diff --git a/.travis.yml b/.travis.yml index 3354ef59b..eea291395 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,18 +10,21 @@ env: - 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 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.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.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/update.sh b/update.sh index 83120aecb..7f4616ccc 100755 --- a/update.sh +++ b/update.sh @@ -161,20 +161,18 @@ 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 2.6.x in Alpine 3.7 doesn't implement - if [[ "$version" == 3.7* ]] && [[ "$variant" == alpine3.7 ]]; 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 "$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" ;;