Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04 (#11831)

Update base image from ubuntu18.04 to ubuntu20.04
Fix necessary dependencies.
After upgrade, Py2 is 2.7.18, Py3 is 3.8.10.
This commit is contained in:
ShiyanWangMS 2022-08-25 15:55:01 +08:00 committed by GitHub
parent 30e79a1a3f
commit 83704d9955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
FROM {{ prefix }}ubuntu:18.04
FROM {{ prefix }}ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
@ -21,8 +21,6 @@ RUN apt-get update && apt-get install -y build-essential \
psmisc \
python \
python-dev \
python-scapy \
python-pip \
python3-pip \
python3-venv \
rsyslog \
@ -31,10 +29,16 @@ RUN apt-get update && apt-get install -y build-essential \
sudo \
tcpdump \
telnet \
vim
vim \
python-is-python2 \
software-properties-common
RUN add-apt-repository -y universe
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
&& python2 get-pip.py
RUN pip install setuptools==44.1.1
RUN pip install cffi==1.10.0 \
RUN pip install cffi==1.12.0 \
contextlib2==0.6.0.post1 \
cryptography==3.3.2 \
"future>=0.16.0" \
@ -96,7 +100,7 @@ RUN pip install cffi==1.10.0 \
&& rm -f 1.0.0.tar.gz \
&& pip install nnpy \
&& pip install dpkt \
&& pip install scapy==2.4.5 --upgrade
&& pip install scapy==2.4.5 --upgrade --ignore-installed
# Install docker-ce-cli
RUN apt-get update \
@ -127,7 +131,7 @@ debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
RUN dpkg --force-all -i \
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
@ -193,8 +197,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0 wheel==0.33.6
RUN python3 -m pip install setuptools-rust \
aiohttp \
defusedxml \
@ -237,7 +240,6 @@ RUN python3 -m pip install setuptools-rust \
tabulate \
textfsm==1.1.2 \
virtualenv \
wheel==0.33.6 \
pysubnettree \
nnpy \
dpkt \