From b88685042bfd58738a553d49e9ff214ee0ef7be5 Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 11 Oct 2023 11:48:56 +0800 Subject: [PATCH 1/6] Init --- Dockerfile | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index f723c87baca..8a3c7dbf113 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,27 +25,13 @@ LABEL maintainer="Microsoft" \ org.label-schema.vcs-url="https://github.com/Azure/azure-cli.git" \ org.label-schema.docker.cmd="docker run -v \${HOME}/.azure:/root/.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION" -# bash gcc make openssl-dev libffi-dev musl-dev - dependencies required for CLI -# openssh - included for ssh-keygen -# ca-certificates -# curl - required for installing jp -# jq - we include jq as a useful tool -# pip wheel - required for CLI packaging -# jmespath-terminal - we include jpterm as a useful tool -# libintl and icu-libs - required by azure devops artifact (az extension add --name azure-devops) +# ca-certificates bash bash-completion - for convenience +# libintl and icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 +# libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 # We don't use openssl (3.0) for now. We only install it so that users can use it. -RUN apk add --no-cache bash openssh ca-certificates jq curl openssl perl git zip \ - && apk add --no-cache --virtual .build-deps gcc make openssl-dev libffi-dev musl-dev linux-headers \ - && apk add --no-cache libintl icu-libs libc6-compat \ - && apk add --no-cache bash-completion \ - && update-ca-certificates - -ARG JP_VERSION="0.2.1" - -RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && curl -L https://github.com/jmespath/jp/releases/download/${JP_VERSION}/jp-linux-$arch -o /usr/local/bin/jp \ - && chmod +x /usr/local/bin/jp +RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat && update-ca-certificates WORKDIR azure-cli COPY . /azure-cli From 5516ed505f4dd5ca8f4fb57b5c8518e3637d788c Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 11 Oct 2023 13:02:46 +0800 Subject: [PATCH 2/6] Minor fix --- Dockerfile | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a3c7dbf113..f7f8e7652c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,33 +27,22 @@ LABEL maintainer="Microsoft" \ # ca-certificates bash bash-completion - for convenience -# libintl and icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 +# libintl icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 # libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 - -# We don't use openssl (3.0) for now. We only install it so that users can use it. -RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat && update-ca-certificates +# gcc python3-dev musl-dev linux-headers libffi-dev - temporarily required by psutil WORKDIR azure-cli COPY . /azure-cli +RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat \ + && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev \ + && update-ca-certificates && ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ + && cat /azure-cli/az.completion > ~/.bashrc \ + && dos2unix /root/.bashrc /usr/local/bin/az \ + && apk del .build-deps -# 1. Build packages and store in tmp dir -# 2. Install the cli and the other command modules that weren't included -RUN ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ - && cat /azure-cli/az.completion > ~/.bashrc \ - && runDeps="$( \ - scanelf --needed --nobanner --recursive /usr/local \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --virtual .rundeps $runDeps +RUN rm -rf /azure-cli WORKDIR / -# Remove CLI source code from the final image and normalize line endings. -RUN rm -rf ./azure-cli && \ - dos2unix /root/.bashrc /usr/local/bin/az - ENV AZ_INSTALLER=DOCKER CMD bash From c5c78d1537b514fdcf3c1f2c9a2314428c2eb1e3 Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 18 Oct 2023 16:14:53 +0800 Subject: [PATCH 3/6] Add jp jq --- alpine.dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/alpine.dockerfile b/alpine.dockerfile index 4bcbf61d011..f9da8462c0d 100644 --- a/alpine.dockerfile +++ b/alpine.dockerfile @@ -26,14 +26,18 @@ LABEL maintainer="Microsoft" \ org.label-schema.docker.cmd="docker run -v \${HOME}/.azure:/root/.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION" -# ca-certificates bash bash-completion - for convenience +# ca-certificates bash bash-completion jq jp - for convenience # libintl icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 # libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 # gcc python3-dev musl-dev linux-headers libffi-dev - temporarily required by psutil +ARG JP_VERSION="0.2.1" +RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && curl -L https://github.com/jmespath/jp/releases/download/${JP_VERSION}/jp-linux-$arch -o /usr/local/bin/jp \ + && chmod +x /usr/local/bin/jp + WORKDIR azure-cli COPY . /azure-cli -RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat \ +RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat jq \ && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev \ && update-ca-certificates && ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ && cat /azure-cli/az.completion > ~/.bashrc \ From acc0cd5d063dea9ce76e8f6b2c84c6705a7b6717 Mon Sep 17 00:00:00 2001 From: Hang Date: Wed, 18 Oct 2023 16:16:58 +0800 Subject: [PATCH 4/6] Minor fix --- alpine.dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/alpine.dockerfile b/alpine.dockerfile index f9da8462c0d..aec4a329a90 100644 --- a/alpine.dockerfile +++ b/alpine.dockerfile @@ -30,18 +30,19 @@ LABEL maintainer="Microsoft" \ # libintl icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 # libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 # gcc python3-dev musl-dev linux-headers libffi-dev - temporarily required by psutil +# curl - temporarily required by jp ARG JP_VERSION="0.2.1" -RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && curl -L https://github.com/jmespath/jp/releases/download/${JP_VERSION}/jp-linux-$arch -o /usr/local/bin/jp \ - && chmod +x /usr/local/bin/jp WORKDIR azure-cli COPY . /azure-cli RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat jq \ - && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev \ + && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev curl \ && update-ca-certificates && ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ && cat /azure-cli/az.completion > ~/.bashrc \ && dos2unix /root/.bashrc /usr/local/bin/az \ + && arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && curl -L https://github.com/jmespath/jp/releases/download/${JP_VERSION}/jp-linux-$arch -o /usr/local/bin/jp \ + && chmod +x /usr/local/bin/jp \ && apk del .build-deps RUN rm -rf /azure-cli From 57469a7e1819a3c897a912cb99413d3e7a47650d Mon Sep 17 00:00:00 2001 From: Hang Date: Thu, 19 Oct 2023 15:56:25 +0800 Subject: [PATCH 5/6] Add openssh-keygen --- alpine.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine.dockerfile b/alpine.dockerfile index aec4a329a90..233dc207d69 100644 --- a/alpine.dockerfile +++ b/alpine.dockerfile @@ -26,7 +26,7 @@ LABEL maintainer="Microsoft" \ org.label-schema.docker.cmd="docker run -v \${HOME}/.azure:/root/.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION" -# ca-certificates bash bash-completion jq jp - for convenience +# ca-certificates bash bash-completion jq jp openssh-keygen - for convenience # libintl icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 # libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 # gcc python3-dev musl-dev linux-headers libffi-dev - temporarily required by psutil @@ -36,7 +36,7 @@ ARG JP_VERSION="0.2.1" WORKDIR azure-cli COPY . /azure-cli -RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat jq \ +RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat jq openssh-keygen \ && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev curl \ && update-ca-certificates && ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ && cat /azure-cli/az.completion > ~/.bashrc \ From ed484817722f51169144ad708b761d0ceee9b431 Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 23 Oct 2023 16:01:37 +0800 Subject: [PATCH 6/6] Minor fix --- alpine.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine.dockerfile b/alpine.dockerfile index 233dc207d69..9773dc70e1b 100644 --- a/alpine.dockerfile +++ b/alpine.dockerfile @@ -27,9 +27,9 @@ LABEL maintainer="Microsoft" \ # ca-certificates bash bash-completion jq jp openssh-keygen - for convenience -# libintl icu-libs - required by azure-devops https://github.com/Azure/azure-cli/pull/9683 +# libintl icu-libs - required by azure-devops extension https://github.com/Azure/azure-cli/pull/9683 # libc6-compat - required by az storage blob sync https://github.com/Azure/azure-cli/issues/10381 -# gcc python3-dev musl-dev linux-headers libffi-dev - temporarily required by psutil +# gcc musl-dev linux-headers libffi-dev - temporarily required by psutil # curl - temporarily required by jp ARG JP_VERSION="0.2.1" @@ -37,7 +37,7 @@ ARG JP_VERSION="0.2.1" WORKDIR azure-cli COPY . /azure-cli RUN apk add --no-cache ca-certificates bash bash-completion libintl icu-libs libc6-compat jq openssh-keygen \ - && apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev linux-headers libffi-dev curl \ + && apk add --no-cache --virtual .build-deps gcc musl-dev linux-headers libffi-dev curl \ && update-ca-certificates && ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ && cat /azure-cli/az.completion > ~/.bashrc \ && dos2unix /root/.bashrc /usr/local/bin/az \