-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Packaging] Add Azure Linux docker image #27204
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
Changes from all commits
dff1c06
0516f14
0f7dcb7
9943174
51dcee3
a38084d
d854e86
021c340
a7d0360
82ea672
8bafcb2
01c58d5
a454719
0f101c2
2bade4e
be98383
33f1f6d
e327a2d
c02fdb2
f000edd
24e6fb5
cb3786e
2dcab39
543c48a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #--------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| #--------------------------------------------------------------------------------------------- | ||
|
|
||
| FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 | ||
|
|
||
| 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://learn.microsoft.com/en-us/cli/azure/run-azure-cli-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-azure" | ||
|
|
||
|
|
||
| # Azure Linux base image does not contain Mozilla CA certificates, install ca-certificates package to prevent CERTIFICATE_VERIFY_FAILED errors, see https://github.com/Azure/azure-cli/issues/26026 | ||
| RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm tdnf install ca-certificates /azure-cli.rpm -y && tdnf clean all && rm -rf /var/cache/tdnf | ||
|
|
||
| ENV AZ_INSTALLER=DOCKER | ||
| CMD bash | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -259,19 +259,15 @@ jobs: | |||||
| inputs: | ||||||
| filePath: build_scripts\windows\scripts\test_msi_installation.ps1 | ||||||
|
|
||||||
| - job: BuildDockerImage | ||||||
| displayName: Build Docker Image | ||||||
|
|
||||||
| dependsOn: ExtractMetadata | ||||||
| condition: succeeded() | ||||||
| - job: BuildDockerImageAlpine | ||||||
| displayName: Build Docker Image Alpine | ||||||
| strategy: | ||||||
| matrix: | ||||||
| AMD64: | ||||||
| pool: ${{ variables.ubuntu_pool }} | ||||||
| artifactName: docker-amd64 | ||||||
| ARM64: | ||||||
| pool: ${{ variables.ubuntu_arm64_pool }} | ||||||
| artifactName: docker-arm64 | ||||||
| ${{ each arch in parameters.architectures }}: | ||||||
| Alpine ${{ arch.name }}: | ||||||
| pool: ${{ arch.pool }} | ||||||
| artifactName: docker-${{ arch.value }} | ||||||
| dockerfile: alpine.dockerfile | ||||||
| pool: | ||||||
| name: $(pool) | ||||||
| steps: | ||||||
|
|
@@ -295,19 +291,18 @@ jobs: | |||||
| TargetPath: $(Build.ArtifactStagingDirectory) | ||||||
| ArtifactName: $(artifactName) | ||||||
|
|
||||||
| - job: TestDockerImage | ||||||
| displayName: Test Docker Image | ||||||
|
|
||||||
| dependsOn: BuildDockerImage | ||||||
| - job: TestDockerImageAlpine | ||||||
| displayName: Test Docker Image Alpine | ||||||
| dependsOn: | ||||||
| - BuildDockerImageAlpine | ||||||
| - ExtractMetadata | ||||||
| condition: succeeded() | ||||||
| strategy: | ||||||
| matrix: | ||||||
| AMD64: | ||||||
| pool: ${{ variables.ubuntu_pool }} | ||||||
| artifactName: docker-amd64 | ||||||
| ARM64: | ||||||
| pool: ${{ variables.ubuntu_arm64_pool }} | ||||||
| artifactName: docker-arm64 | ||||||
| ${{ each arch in parameters.architectures }}: | ||||||
| Alpine ${{ arch.name }}: | ||||||
| pool: ${{ arch.pool }} | ||||||
| artifactName: docker-${{ arch.name }} | ||||||
| pool: | ||||||
| name: $(pool) | ||||||
| steps: | ||||||
|
|
@@ -317,7 +312,6 @@ jobs: | |||||
| TargetPath: '$(Build.ArtifactStagingDirectory)/metadata' | ||||||
| artifactName: metadata | ||||||
|
|
||||||
|
|
||||||
| - task: DownloadPipelineArtifact@1 | ||||||
| displayName: 'Download Docker Image' | ||||||
| inputs: | ||||||
|
|
@@ -340,6 +334,88 @@ jobs: | |||||
| 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: BuildRpmPackageMariner | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This job should be renamed:
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| strategy: | ||||||
| matrix: | ||||||
| ${{ each arch in parameters.architectures }}: | ||||||
| Mariner 2.0 ${{ arch.name }}: | ||||||
| pool: ${{ arch.pool }} | ||||||
| artifactName: docker-mariner2.0-${{ arch.value }} | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The artifact name is This is the reply from Mariner team:
|
||||||
| dockerfile: azure-linux.dockerfile | ||||||
| packageArtifactName: rpm-mariner2.0-${{ arch.value }} | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question here about mariner version: does it make sense to make the version a variable to allow for mariner 3.0 down the road? |
||||||
| pool: | ||||||
| name: $(pool) | ||||||
| steps: | ||||||
| - bash: ./scripts/ci/install_docker.sh | ||||||
| displayName: Install Docker | ||||||
| - task: DownloadPipelineArtifact@1 | ||||||
| displayName: 'Download Build Artifacts' | ||||||
| inputs: | ||||||
| TargetPath: '$(Build.ArtifactStagingDirectory)/docker' | ||||||
| artifactName: $(packageArtifactName) | ||||||
| - bash: | | ||||||
| set -ex | ||||||
| mkdir docker-temp | ||||||
| mv $(Build.ArtifactStagingDirectory)/docker/*.rpm ./docker-temp/azure-cli.rpm | ||||||
|
|
||||||
| bash scripts/release/docker/pipeline.sh | ||||||
| displayName: 'Build Docker' | ||||||
|
|
||||||
| - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 | ||||||
| displayName: 'SBOM' | ||||||
| inputs: | ||||||
| BuildDropPath: $(Build.ArtifactStagingDirectory) | ||||||
| DockerImagesToScan: 'clibuild$BUILD_BUILDNUMBER:latest' | ||||||
|
|
||||||
| - task: PublishPipelineArtifact@0 | ||||||
| inputs: | ||||||
| TargetPath: $(Build.ArtifactStagingDirectory) | ||||||
| ArtifactName: $(artifactName) | ||||||
|
|
||||||
| - job: TestDockerImageAzureLinux | ||||||
| displayName: Test Docker Image Azure Linux | ||||||
| dependsOn: | ||||||
| - BuildDockerImageAzureLinux | ||||||
| - ExtractMetadata | ||||||
| strategy: | ||||||
| matrix: | ||||||
| ${{ each arch in parameters.architectures }}: | ||||||
| Mariner 2.0 ${{ arch.name }}: | ||||||
| pool: ${{ arch.pool }} | ||||||
| artifactName: docker-mariner2.0-${{ 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: BuildPythonWheel | ||||||
| displayName: Build Python Wheels | ||||||
|
|
||||||
|
|
@@ -1098,8 +1174,10 @@ jobs: | |||||
| - VerifyVersions | ||||||
| - BuildWindowsMSI | ||||||
| - TestMsiInstallation | ||||||
| - BuildDockerImage | ||||||
| - TestDockerImage | ||||||
| - BuildDockerImageAlpine | ||||||
| - TestDockerImageAlpine | ||||||
| - BuildDockerImageAzureLinux | ||||||
| - TestDockerImageAzureLinux | ||||||
| - BuildPythonWheel | ||||||
| - TestPythonWheel | ||||||
| - TestCore | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why
alpine.dockerfileusesCOPY . /azure-cliinstead of--mount=type=bind.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--mountwas added in dockerfile:1.2 on 2020-12-03.