From eb3484422c5473217707a78575263df0be01761b Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Tue, 20 Aug 2024 14:44:58 +0800 Subject: [PATCH 1/2] Init --- azure-pipelines.yml | 79 --------------------------------------------- 1 file changed, 79 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e3d1ec219ae..b7486f4d937 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -324,83 +324,6 @@ jobs: inputs: filePath: build_scripts\windows\scripts\test_zip_installation.ps1 -- job: BuildDockerImageAlpine - continueOnError: true - displayName: Build Docker Image Alpine - strategy: - matrix: - ${{ each arch in parameters.architectures }}: - ${{ arch.name }}: - pool: ${{ arch.pool }} - artifactName: docker-${{ arch.value }} - dockerfile: alpine.dockerfile - pool: - name: $(pool) - steps: - - bash: ./scripts/ci/install_docker.sh - displayName: Install Docker - - task: Bash@3 - displayName: 'Bash Script' - inputs: - targetType: 'filePath' - filePath: scripts/release/docker/pipeline.sh - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'SBOM' - inputs: - BuildDropPath: $(Build.ArtifactStagingDirectory) - DockerImagesToScan: 'clibuild$BUILD_BUILDNUMBER:latest' - - - task: PublishPipelineArtifact@0 - displayName: 'Publish Artifact: docker image' - inputs: - TargetPath: $(Build.ArtifactStagingDirectory) - ArtifactName: $(artifactName) - -- job: TestDockerImageAlpine - continueOnError: true - displayName: Test Docker Image Alpine - dependsOn: - - BuildDockerImageAlpine - - ExtractMetadata - condition: succeeded() - strategy: - matrix: - ${{ each arch in parameters.architectures }}: - ${{ arch.name }}: - pool: ${{ arch.pool }} - artifactName: docker-${{ arch.value }} - pool: - name: $(pool) - steps: - - task: DownloadPipelineArtifact@1 - displayName: 'Download Metadata' - inputs: - TargetPath: '$(Build.ArtifactStagingDirectory)/metadata' - artifactName: metadata - - - task: DownloadPipelineArtifact@1 - displayName: 'Download Docker Image' - inputs: - TargetPath: '$(Build.ArtifactStagingDirectory)/docker' - artifactName: $(artifactName) - - - bash: ./scripts/ci/install_docker.sh - displayName: Install Docker - - - bash: | - set -exv - - CLI_VERSION=`cat $SYSTEM_ARTIFACTSDIRECTORY/metadata/version` - IMAGE_NAME=clibuild$BUILD_BUILDNUMBER:latest - TAR_FILE=$SYSTEM_ARTIFACTSDIRECTORY/docker/docker-azure-cli-$CLI_VERSION.tar - - echo "== Test docker image ==" - - docker load < $TAR_FILE - docker run $IMAGE_NAME /bin/bash -c "time az self-test && time az --version && sleep 5" - displayName: 'Bash Script' - - job: BuildDockerImageAzureLinux displayName: Build Docker Image Azure Linux dependsOn: BuildRpmPackagesAzureLinux @@ -1252,8 +1175,6 @@ jobs: - TestMsiInstallation - BuildWindowsZIP - TestZipInstallation - - BuildDockerImageAlpine - - TestDockerImageAlpine - BuildDockerImageAzureLinux - TestDockerImageAzureLinux - BuildPythonWheel From ead98cdb4baec9ccc31d8a30b3c08cf38d7beff6 Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 9 Sep 2024 09:55:52 +0800 Subject: [PATCH 2/2] Remove unused docker --- alpine.dockerfile | 51 -------------------------- scripts/release/rpm/centos7.dockerfile | 26 ------------- 2 files changed, 77 deletions(-) delete mode 100644 alpine.dockerfile delete mode 100644 scripts/release/rpm/centos7.dockerfile diff --git a/alpine.dockerfile b/alpine.dockerfile deleted file mode 100644 index 6be4f640f0a..00000000000 --- a/alpine.dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -#--------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -#--------------------------------------------------------------------------------------------- - -ARG PYTHON_VERSION="3.11" - -FROM python:${PYTHON_VERSION}-alpine - -ARG CLI_VERSION - -# Metadata as defined at http://label-schema.org -ARG BUILD_DATE - -LABEL maintainer="Microsoft" \ - org.label-schema.schema-version="1.0" \ - org.label-schema.vendor="Microsoft" \ - org.label-schema.name="Azure CLI" \ - org.label-schema.version=$CLI_VERSION \ - org.label-schema.license="MIT" \ - org.label-schema.description="A great cloud needs great tools; we're excited to introduce Azure CLI, our next generation multi-platform command line experience for Azure." \ - org.label-schema.url="https://docs.microsoft.com/cli/azure/overview" \ - org.label-schema.usage="https://docs.microsoft.com/cli/azure/install-az-cli2#docker" \ - org.label-schema.build-date=$BUILD_DATE \ - 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" - - -# ca-certificates bash bash-completion jq jp openssh-keygen - for convenience -# 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 musl-dev linux-headers libffi-dev - temporarily required by psutil -# curl - temporarily required by jp - -ARG JP_VERSION="0.2.1" - -RUN --mount=type=bind,target=/azure-cli,source=./,rw 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 musl-dev linux-headers libffi-dev curl \ - && update-ca-certificates && pip install --upgrade pip setuptools && cd /azure-cli && ./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 - -WORKDIR / - -ENV AZ_INSTALLER=DOCKER -CMD bash diff --git a/scripts/release/rpm/centos7.dockerfile b/scripts/release/rpm/centos7.dockerfile deleted file mode 100644 index 6e3219b4990..00000000000 --- a/scripts/release/rpm/centos7.dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -ARG tag=centos7 - -FROM centos:${tag} AS build-env -ARG cli_version=dev - -RUN yum update -y -RUN yum install -y wget rpm-build gcc libffi-devel python3-devel openssl-devel make bash coreutils diffutils patch dos2unix python3-virtualenv - -WORKDIR /azure-cli - -COPY . . - -# CentOS 7 only has 'python3' package, which is Python 3.6. -RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \ - REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=python3 PYTHON_CMD=python3 \ - rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \ - cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.*.x86_64.rpm /azure-cli-dev.rpm - -FROM centos:${tag} AS execution-env - -RUN yum update -y -RUN yum install -y python3 python3-virtualenv - -COPY --from=build-env /azure-cli-dev.rpm ./ -RUN rpm -i ./azure-cli-dev.rpm && \ - az --version