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.
This commit is contained in:
parent
b78e3a0d20
commit
936f8689b9
@ -261,6 +261,7 @@ WORKDIR /var/$user
|
|||||||
# Add az symlink for backwards compatibility
|
# Add az symlink for backwards compatibility
|
||||||
RUN mkdir bin && ln -s /usr/bin/az bin/az
|
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
|
RUN python3 -m venv --system-site-packages env-python3
|
||||||
|
|
||||||
# Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD.
|
# 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
|
# Deactivating a virtualenv
|
||||||
ENV PATH="$BACKUP_OF_PATH"
|
ENV PATH="$BACKUP_OF_PATH"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
WORKDIR /azp
|
WORKDIR /azp
|
||||||
COPY start.sh \
|
COPY start.sh \
|
||||||
0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch \
|
0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch \
|
||||||
./
|
./
|
||||||
RUN chmod +x start.sh \
|
RUN chmod +x start.sh \
|
||||||
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||||
&& ln -sf `which pip3` /usr/bin/pip \
|
&& ln -sf `which pip3` /usr/bin/pip \
|
||||||
|
Reference in New Issue
Block a user