Skip to content

Commit 83704d9

Browse files
authored
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.
1 parent 30e79a1 commit 83704d9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

dockers/docker-sonic-mgmt/Dockerfile.j2

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set prefix = DEFAULT_CONTAINER_REGISTRY %}
2-
FROM {{ prefix }}ubuntu:18.04
2+
FROM {{ prefix }}ubuntu:20.04
33

44
ENV DEBIAN_FRONTEND=noninteractive
55

@@ -21,8 +21,6 @@ RUN apt-get update && apt-get install -y build-essential \
2121
psmisc \
2222
python \
2323
python-dev \
24-
python-scapy \
25-
python-pip \
2624
python3-pip \
2725
python3-venv \
2826
rsyslog \
@@ -31,10 +29,16 @@ RUN apt-get update && apt-get install -y build-essential \
3129
sudo \
3230
tcpdump \
3331
telnet \
34-
vim
32+
vim \
33+
python-is-python2 \
34+
software-properties-common
35+
36+
RUN add-apt-repository -y universe
37+
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
38+
&& python2 get-pip.py
3539

3640
RUN pip install setuptools==44.1.1
37-
RUN pip install cffi==1.10.0 \
41+
RUN pip install cffi==1.12.0 \
3842
contextlib2==0.6.0.post1 \
3943
cryptography==3.3.2 \
4044
"future>=0.16.0" \
@@ -96,7 +100,7 @@ RUN pip install cffi==1.10.0 \
96100
&& rm -f 1.0.0.tar.gz \
97101
&& pip install nnpy \
98102
&& pip install dpkt \
99-
&& pip install scapy==2.4.5 --upgrade
103+
&& pip install scapy==2.4.5 --upgrade --ignore-installed
100104

101105
# Install docker-ce-cli
102106
RUN apt-get update \
@@ -127,7 +131,7 @@ debs/{{ deb }}{{' '}}
127131
{%- endfor -%}
128132
debs/
129133

130-
RUN dpkg -i \
134+
RUN dpkg --force-all -i \
131135
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
132136
debs/{{ deb }}{{' '}}
133137
{%- endfor %}
@@ -193,8 +197,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
193197

194198
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8
195199

196-
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0
197-
200+
RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0 wheel==0.33.6
198201
RUN python3 -m pip install setuptools-rust \
199202
aiohttp \
200203
defusedxml \
@@ -237,7 +240,6 @@ RUN python3 -m pip install setuptools-rust \
237240
tabulate \
238241
textfsm==1.1.2 \
239242
virtualenv \
240-
wheel==0.33.6 \
241243
pysubnettree \
242244
nnpy \
243245
dpkt \

0 commit comments

Comments
 (0)