Skip to content

Commit c6c8c93

Browse files
authored
[buildfix-201911] Fix the snmp docker build error. (#7452)
Issue is get_pip.py is moved to pip 21.1 (https://github.com/pypa/get-pip/commits/main) which is not compatible with 3.6. Issue of pip itself is fixed as part of 21.1.1 in pip community (pypa/pip#9835). However get-pip.py is still not updated to latest pip. Also get.pip.py does not support python 3.6 version explicitly (pypa/get-pip#88) Step 15/29 : RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6 ---> Running in bece31f49267 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 1891k 100 1891k 0 0 9564k 0 --:--:-- --:--:-- --:--:-- 9600k Traceback (most recent call last): File "<stdin>", line 24298, in <module> File "<stdin>", line 139, in main File "<stdin>", line 115, in bootstrap File "<stdin>", line 96, in monkeypatch_for_cert File "/tmp/tmp5fnxrz0a/pip.zip/pip/_internal/commands/__init__.py", line 9, in <module> File "/tmp/tmp5fnxrz0a/pip.zip/pip/_internal/cli/base_command.py", line 12, in <module> File "/tmp/tmp5fnxrz0a/pip.zip/pip/_internal/cli/cmdoptions.py", line 30, in <module> File "/tmp/tmp5fnxrz0a/pip.zip/pip/_internal/utils/hashes.py", line 2, in <module> ImportError: cannot import name 'NoReturn' The command '/bin/sh -c curl https://bootstrap.pypa.io/get-pip.py | python3.6' returned a non-zero code: 1 How I did: Got the file from https://github.com/pypa/get-pip/tree/21.0 and added to the buildimage pin pip to the previous release 21.0.1. (Similar is done in other public repos eg: grpc/grpc-java#8115) Signed-off-by: Abhishek Dosi <[email protected]>
1 parent a754e4b commit c6c8c93

File tree

2 files changed

+24228
-2
lines changed

2 files changed

+24228
-2
lines changed

dockers/docker-snmp-sv2/Dockerfile.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ ENV LC_CTYPE=en_US.UTF-8
4242
RUN sed -i '/^#.* en_US.* /s/^#//' /etc/locale.gen
4343
RUN locale-gen
4444

45-
# Install up-to-date version of pip
46-
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
45+
COPY ["get-pip.py", "/usr/bin/"]
46+
RUN python3.6 /usr/bin/get-pip.py pip==21.0.1
4747

4848
# pin down setuptools version for issues to install sonic_ax_impl
4949
# see https://github.com/Azure/sonic-buildimage/issues/5279

0 commit comments

Comments
 (0)