Skip to content

Commit

Permalink
Upgrade docker-sonic-mgmt base image from Ubuntu18.04 to 20.04 (#11831)
Browse files Browse the repository at this point in the history
Update base image from ubuntu18.04 to ubuntu20.04
Fix necessary dependencies.
After upgrade, Py2 is 2.7.18, Py3 is 3.8.10.
  • Loading branch information
wsycqyz authored Aug 25, 2022
1 parent 30e79a1 commit 83704d9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions dockers/docker-sonic-mgmt/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
FROM {{ prefix }}ubuntu:18.04
FROM {{ prefix }}ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -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 \
Expand All @@ -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" \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -237,7 +240,6 @@ RUN python3 -m pip install setuptools-rust \
tabulate \
textfsm==1.1.2 \
virtualenv \
wheel==0.33.6 \
pysubnettree \
nnpy \
dpkt \
Expand Down

0 comments on commit 83704d9

Please sign in to comment.