From 4fd71b0961ba1e48a60482e35204350222827513 Mon Sep 17 00:00:00 2001 From: Shiyan Date: Wed, 29 Nov 2023 15:17:35 +0800 Subject: [PATCH] Remove Python3 venv in Python3-only sonic-mgmt-docker --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 0c578fa2b100..63985576bd12 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -261,6 +261,7 @@ WORKDIR /var/$user # Add az symlink for backwards compatibility RUN mkdir bin && ln -s /usr/bin/az bin/az +{% if legacy == 'y' or legacy == '1' %} RUN python3 -m venv --system-site-packages env-python3 # Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. @@ -341,12 +342,13 @@ RUN python3 -m pip install aiohttp \ # Deactivating a virtualenv ENV PATH="$BACKUP_OF_PATH" +{% endif %} USER root WORKDIR /azp COPY start.sh \ 0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch \ - ./ + ./ RUN chmod +x start.sh \ && ln -sf /usr/bin/python3 /usr/bin/python \ && ln -sf `which pip3` /usr/bin/pip \