Skip to content

Commit eba6ef0

Browse files
authored
Remove Python3 venv in Python3-only sonic-mgmt-docker (#17337)
How I did it Remove Python3 venv in Python3-only sonic-mgmt-docker How to verify it There is no impact to sonic-mgmt-docker:latest tag. Build sonic-mgmt-docker with LEGACY_SONIC_MGMT_DOCKER=y, see python3 venv is there. Build sonic-mgmt-docker with LEGACY_SONIC_MGMT_DOCKER=n, see python3 venv is NOT included.
1 parent f13081b commit eba6ef0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dockers/docker-sonic-mgmt/Dockerfile.j2

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ WORKDIR /var/$user
261261
# Add az symlink for backwards compatibility
262262
RUN mkdir bin && ln -s /usr/bin/az bin/az
263263

264+
{% if legacy == 'y' or legacy == '1' %}
264265
RUN python3 -m venv --system-site-packages env-python3
265266

266267
# Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD.
@@ -341,12 +342,13 @@ RUN python3 -m pip install aiohttp \
341342

342343
# Deactivating a virtualenv
343344
ENV PATH="$BACKUP_OF_PATH"
345+
{% endif %}
344346

345347
USER root
346348
WORKDIR /azp
347349
COPY start.sh \
348350
0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch \
349-
./
351+
./
350352
RUN chmod +x start.sh \
351353
&& ln -sf /usr/bin/python3 /usr/bin/python \
352354
&& ln -sf `which pip3` /usr/bin/pip \

0 commit comments

Comments
 (0)