Skip to content

Commit 6bb0483

Browse files
authored
[sonic-mgmt] install newest az-cli to mitigate old version az-cli issue (#15621)
Force merge to work around the az-cli installation issue.
1 parent 2f4cd3a commit 6bb0483

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

dockers/docker-sonic-mgmt/Dockerfile.j2

+10-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ ENV DEBIAN_FRONTEND=noninteractive
55

66
RUN apt-get update && apt-get install -y apt-transport-https \
77
apt-utils \
8-
azure-cli \
98
build-essential \
109
ca-certificates \
1110
cmake \
1211
curl \
1312
default-jre \
1413
git \
14+
gnupg \
15+
gnupg-agent \
1516
iproute2 \
1617
iputils-ping \
1718
isc-dhcp-client \
@@ -122,16 +123,18 @@ RUN pip install allure-pytest==2.8.22 \
122123
&& pip install scapy==2.4.5 --upgrade --ignore-installed
123124

124125
# Install docker-ce-cli
125-
RUN apt-get update \
126-
&& apt-get install -y \
127-
apt-transport-https \
128-
ca-certificates \
129-
gnupg-agent \
130-
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
126+
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
131127
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
132128
&& apt-get update \
133129
&& apt-get install -y docker-ce-cli
134130

131+
# Install Azure CLI, following https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-2-step-by-step-installation-instructions
132+
RUN mkdir -p /etc/apt/keyrings \
133+
&& curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null \
134+
&& chmod go+r /etc/apt/keyrings/microsoft.gpg \
135+
&& echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | tee /etc/apt/sources.list.d/azure-cli.list \
136+
&& apt-get update && apt-get install -y azure-cli
137+
135138
## Copy and install sonic-mgmt docker dependencies
136139
COPY \
137140
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}

0 commit comments

Comments
 (0)