Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-mgmt] install newest az-cli to mitigate old version az-cli issue #15621

Merged
merged 2 commits into from
Jun 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion dockers/docker-sonic-mgmt/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y apt-transport-https \
apt-utils \
azure-cli \
build-essential \
ca-certificates \
cmake \
Expand Down Expand Up @@ -132,6 +131,19 @@ RUN apt-get update \
&& apt-get update \
&& apt-get install -y docker-ce-cli

# 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
RUN apt-get update \
&&apt-get install -y ca-certificates \
curl \
apt-transport-https \
lsb-release gnupg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take this chance to move installation of the dependencies to the top apt-get install?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refined

RUN mkdir -p /etc/apt/keyrings
RUN curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null
RUN chmod go+r /etc/apt/keyrings/microsoft.gpg
RUN AZ_REPO=$(lsb_release -cs)
RUN echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update && apt-get install -y azure-cli

## Copy and install sonic-mgmt docker dependencies
COPY \
{% for deb in docker_sonic_mgmt_debs.split(' ') -%}
Expand Down