From b132ca098078d6ef0321424ca468111e01949506 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 29 Oct 2020 19:01:17 -0700 Subject: [PATCH] [build]: Upgrade pip3 before pip2 (#5743) Upgrading pip3 after pip2 caused the pip command to be aliased to the pip3 command. However, since we are still transitioning from Python 2 to Python 3, most pip commands in the codebase are expecting pip to alias to pip2. The proper solution here is to explicitly call pip2 and pip3, and no longer call pip, however this will require extensive changes and testing, so to quickly fix this issue, we upgraded pip2 after pip3 to ensure that pip2 is installed after pip3. --- dockers/docker-config-engine-buster/Dockerfile.j2 | 2 +- sonic-slave-buster/Dockerfile.j2 | 2 +- sonic-slave-stretch/Dockerfile.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dockers/docker-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index 55156209f4b9..9e21571bbbf7 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -15,8 +15,8 @@ RUN apt-get update && \ python-setuptools \ python3-setuptools -RUN pip2 install --upgrade pip RUN pip3 install --upgrade pip +RUN pip2 install --upgrade pip RUN apt-get purge -y python-pip python3-pip # For sonic-config-engine Python 3 package diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index ce406cd70744..03dae31ecd46 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -334,8 +334,8 @@ RUN export VERSION=1.14.2 \ && echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \ && rm go$VERSION.linux-*.tar.gz -RUN pip2 install --upgrade pip RUN pip3 install --upgrade pip +RUN pip2 install --upgrade pip RUN apt-get purge -y python-pip python3-pip # For building Python packages diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 3f455bdd7bc6..276bdcbbc1dd 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -330,8 +330,8 @@ RUN export VERSION=1.14.2 \ && echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \ && rm go$VERSION.linux-*.tar.gz -RUN pip2 install --upgrade pip RUN pip3 install --upgrade pip +RUN pip2 install --upgrade pip RUN apt-get purge -y python-pip python3-pip # For p4 build