From 50fc273793dbbbc371c09b149a79af5ae4e279dd Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 5 Aug 2016 15:11:16 -0700 Subject: [PATCH] Revert "Use "dpkg-divert" instead of "purge" to avoid Debian's Python" - this reverts commit a819c92949e182901df10e52d41bc57c6ca73bd5. - since Debian packages use an absolute path, they were broken by the diverts - ensure the local python is first in PATH --- 2.7/Dockerfile | 16 ++-------------- 2.7/slim/Dockerfile | 3 +++ 2.7/wheezy/Dockerfile | 16 ++-------------- 3.3/Dockerfile | 16 ++-------------- 3.3/slim/Dockerfile | 3 +++ 3.3/wheezy/Dockerfile | 16 ++-------------- 3.4/Dockerfile | 16 ++-------------- 3.4/slim/Dockerfile | 3 +++ 3.4/wheezy/Dockerfile | 16 ++-------------- 3.5/Dockerfile | 16 ++-------------- 3.5/slim/Dockerfile | 3 +++ 3.6/Dockerfile | 16 ++-------------- 3.6/slim/Dockerfile | 3 +++ 13 files changed, 31 insertions(+), 112 deletions(-) diff --git a/2.7/Dockerfile b/2.7/Dockerfile index 9b1ffaa..0a2d28d 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. diff --git a/2.7/slim/Dockerfile b/2.7/slim/Dockerfile index 7a72af3..b7fad41 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 diff --git a/2.7/wheezy/Dockerfile b/2.7/wheezy/Dockerfile index 9731b10..5ae74f5 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. diff --git a/3.3/Dockerfile b/3.3/Dockerfile index 3ef68f8..51d158a 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. diff --git a/3.3/slim/Dockerfile b/3.3/slim/Dockerfile index f54ea74..5973a0a 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 diff --git a/3.3/wheezy/Dockerfile b/3.3/wheezy/Dockerfile index 45e63bc..e17d02a 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. diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 121e4a5..57839f6 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. diff --git a/3.4/slim/Dockerfile b/3.4/slim/Dockerfile index b25f47d..97e25cf 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 diff --git a/3.4/wheezy/Dockerfile b/3.4/wheezy/Dockerfile index 959aacc..fcc8186 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. diff --git a/3.5/Dockerfile b/3.5/Dockerfile index f3971ec..b494dcd 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. diff --git a/3.5/slim/Dockerfile b/3.5/slim/Dockerfile index 2ff34f0..0c88f2c 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 diff --git a/3.6/Dockerfile b/3.6/Dockerfile index 3489079..b4b61e6 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. diff --git a/3.6/slim/Dockerfile b/3.6/slim/Dockerfile index 4e0cc12..7e407df 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