Skip to content

Commit

Permalink
Remove Python3 venv in Python3-only sonic-mgmt-docker (sonic-net#17337)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wsycqyz authored Nov 30, 2023
1 parent f13081b commit eba6ef0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dockers/docker-sonic-mgmt/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit eba6ef0

Please sign in to comment.