diff --git a/2.7/Dockerfile b/2.7/Dockerfile index 9b1ffaa96..ea1dc0837 100644 --- a/2.7/Dockerfile +++ b/2.7/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:jessie -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -59,9 +47,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/2.7/alpine/Dockerfile b/2.7/alpine/Dockerfile index 056c49283..d540e39fd 100644 --- a/2.7/alpine/Dockerfile +++ b/2.7/alpine/Dockerfile @@ -50,9 +50,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/2.7/slim/Dockerfile b/2.7/slim/Dockerfile index 7a72af34c..ee7b1cd09 100644 --- a/2.7/slim/Dockerfile +++ b/2.7/slim/Dockerfile @@ -1,5 +1,8 @@ FROM debian:jessie +# ensure local python is used over debian 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 @@ -57,9 +60,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile index 9731b10b1..e68c736af 100644 --- a/2.7/wheezy/Dockerfile +++ b/2.7/wheezy/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:wheezy -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -59,9 +47,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.3/Dockerfile b/3.3/Dockerfile index 3ef68f81e..0ca77a653 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:jessie -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -59,9 +47,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.3/alpine/Dockerfile b/3.3/alpine/Dockerfile index e7d5d1fd7..bb1f6011a 100644 --- a/3.3/alpine/Dockerfile +++ b/3.3/alpine/Dockerfile @@ -51,9 +51,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/3.3/slim/Dockerfile b/3.3/slim/Dockerfile index f54ea740b..030cff5b3 100644 --- a/3.3/slim/Dockerfile +++ b/3.3/slim/Dockerfile @@ -1,5 +1,8 @@ FROM debian:jessie +# ensure local python is used over debian 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 @@ -58,9 +61,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.3/wheezy/Dockerfile b/3.3/wheezy/Dockerfile index 45e63bc11..0f1787ebb 100644 --- a/3.3/wheezy/Dockerfile +++ b/3.3/wheezy/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:wheezy -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -59,9 +47,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 121e4a518..e66500d5f 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:jessie -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -58,9 +46,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.4/alpine/Dockerfile b/3.4/alpine/Dockerfile index 57b9f784a..6ca15c6cf 100644 --- a/3.4/alpine/Dockerfile +++ b/3.4/alpine/Dockerfile @@ -51,9 +51,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/3.4/slim/Dockerfile b/3.4/slim/Dockerfile index b25f47d12..17adf6129 100644 --- a/3.4/slim/Dockerfile +++ b/3.4/slim/Dockerfile @@ -1,5 +1,8 @@ FROM debian:jessie +# ensure local python is used over debian 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 @@ -57,9 +60,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index 959aaccac..9d52bc896 100644 --- a/3.4/wheezy/Dockerfile +++ b/3.4/wheezy/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:wheezy -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -58,9 +46,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.5/Dockerfile b/3.5/Dockerfile index f3971ecf9..a52b1588e 100644 --- a/3.5/Dockerfile +++ b/3.5/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:jessie -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -58,9 +46,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.5/alpine/Dockerfile b/3.5/alpine/Dockerfile index ccae08c80..355ee1d14 100644 --- a/3.5/alpine/Dockerfile +++ b/3.5/alpine/Dockerfile @@ -51,9 +51,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/3.5/slim/Dockerfile b/3.5/slim/Dockerfile index 2ff34f07e..4a5ed5644 100644 --- a/3.5/slim/Dockerfile +++ b/3.5/slim/Dockerfile @@ -1,5 +1,8 @@ FROM debian:jessie +# ensure local python is used over debian 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 @@ -57,9 +60,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.6/Dockerfile b/3.6/Dockerfile index 348907912..7652dc62e 100644 --- a/3.6/Dockerfile +++ b/3.6/Dockerfile @@ -1,19 +1,7 @@ FROM buildpack-deps:jessie -# divert many traces of Debian Python (so that they are not used by mistake) -# https://bugs.debian.org/33263 :( -RUN set -ex \ - && for bits in \ -# /etc/python* \ - /usr/bin/*2to3* \ - /usr/bin/*python* \ - /usr/bin/pdb* \ - /usr/bin/py* \ -# /usr/lib/python* \ -# /usr/share/python \ - ; do \ - dpkg-divert --rename "$bits"; \ - done +# ensure local python is used over debian 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. @@ -58,9 +46,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache diff --git a/3.6/alpine/Dockerfile b/3.6/alpine/Dockerfile index 45e1e0d9f..f61c26caf 100644 --- a/3.6/alpine/Dockerfile +++ b/3.6/alpine/Dockerfile @@ -51,9 +51,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/3.6/slim/Dockerfile b/3.6/slim/Dockerfile index 4e0cc1294..5ceb89df0 100644 --- a/3.6/slim/Dockerfile +++ b/3.6/slim/Dockerfile @@ -1,5 +1,8 @@ FROM debian:jessie +# ensure local python is used over debian 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 @@ -57,9 +60,9 @@ RUN set -ex \ && [ "$(pip list | awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ && find /usr/local -depth \ \( \ - \( -type d -a -name test -o -name tests \) \ - -o \ - \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ + \( -type d -a -name test -o -name tests \) \ + -o \ + \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ \) -exec rm -rf '{}' + \ && apt-get purge -y --auto-remove $buildDeps \ && rm -rf /usr/src/python ~/.cache