-
Notifications
You must be signed in to change notification settings - Fork 298
devops: move docker publishing to Azure DevOps #1986
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
Merged
Yury Semikhatsky (yury-s)
merged 4 commits into
microsoft:main
from
yury-s:devops-docker-ado
Sep 15, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5205d08
devops: move docker publishing to Azure DevOps
yury-s 1087f78
chore(docker): mount maven settings secret at its default path
yury-s 17e1239
devops(docker): add canary release channel for manual pipeline runs
yury-s 4dbbfd1
devops(docker): retry arm64 image builds under QEMU
yury-s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| # Trigger: any `v*` release tag (e.g. v1.40.0). | ||
| # Can also be queued manually from the ADO UI. | ||
| trigger: | ||
| tags: | ||
| include: | ||
| - v* | ||
| exclude: | ||
| - v*-* | ||
|
|
||
| pr: none | ||
|
|
||
| parameters: | ||
| - name: releaseChannel | ||
| displayName: "IMPORTANT: set this to 'canary' when triggering manually" | ||
| type: string | ||
| default: stable | ||
| values: | ||
| - stable | ||
| - canary | ||
|
|
||
| resources: | ||
| repositories: | ||
| - repository: 1esPipelines | ||
| type: git | ||
| name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
| ref: refs/tags/release | ||
|
|
||
| extends: | ||
| template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines | ||
| parameters: | ||
| pool: | ||
| name: DevDivPlaywrightAzurePipelinesUbuntu2204 | ||
| os: linux | ||
| sdl: | ||
| sourceAnalysisPool: | ||
| name: DevDivPlaywrightAzurePipelinesWindows2022 | ||
| # The image must be windows-based due to restrictions of the SDL tools. See: https://aka.ms/AAo6v8e | ||
| os: windows | ||
| suppression: | ||
| suppressionFile: $(Build.SourcesDirectory)\.azure-pipelines\guardian\SDL\.gdnsuppress | ||
| stages: | ||
| - stage: Publish | ||
| jobs: | ||
| - job: PublishDocker | ||
| displayName: "Publish Docker images to ACR" | ||
| # arm64 images are cross-built under QEMU emulation, which is slow. | ||
| timeoutInMinutes: 360 | ||
| steps: | ||
| - checkout: self | ||
| displayName: "Checkout code" | ||
|
|
||
| - task: UseNode@1 | ||
| inputs: | ||
| version: '26.x' | ||
| displayName: "Install Node.js" | ||
|
|
||
| # Relocate the Docker data-root to the large /mnt volume: this job builds | ||
| # 6 images (jammy/noble/resolute x amd64/arm64) and `docker system prune`s | ||
| # between them, so the default disk fills up. | ||
| - task: Bash@3 | ||
| displayName: "Setup docker" | ||
| inputs: | ||
| targetType: "inline" | ||
| script: | | ||
| set -x | ||
| sudo service docker stop | ||
| sudo mkdir -p /etc/docker | ||
| echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json | ||
| sudo service docker start | ||
|
|
||
| # Used by scripts/download_driver.sh on the host. The repository root is the | ||
| # Docker build context, so .dockerignore keeps this file out of the images. | ||
| - task: Bash@3 | ||
| displayName: "setup .npmrc" | ||
| inputs: | ||
| targetType: "inline" | ||
| script: | | ||
| echo "registry=https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/DevDiv_PublicPackages/npm/registry/" >> .npmrc | ||
|
|
||
| - task: npmAuthenticate@0 | ||
| displayName: "authenticate the private npm registry" | ||
| inputs: | ||
| workingFile: .npmrc | ||
|
|
||
| # Must run before MavenAuthenticate@0 so the credentials it injects into | ||
| # ~/.m2/settings.xml are not overwritten by the copy. | ||
| - bash: | | ||
| mkdir -p ~/.m2 | ||
| cp .azure-pipelines/settings.xml ~/.m2/settings.xml | ||
| displayName: 'Copy settings.xml (mirror Maven Central to DevDiv_PublicPackages)' | ||
|
|
||
| - task: MavenAuthenticate@0 | ||
| displayName: 'Authenticate to DevDiv_PublicPackages feed' | ||
| inputs: | ||
| artifactsFeeds: DevDiv_PublicPackages | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: "Login to ACR via OIDC" | ||
| inputs: | ||
| azureSubscription: "Playwright-CDN" | ||
| scriptType: "bash" | ||
| scriptLocation: "inlineScript" | ||
| inlineScript: "az acr login --name playwright" | ||
|
|
||
| - task: Bash@3 | ||
| displayName: "Register QEMU (binfmt) for arm64 cross-build" | ||
| inputs: | ||
| targetType: "inline" | ||
| script: "docker run --rm --privileged ${ACR_CACHE_PREFIX}tonistiigi/binfmt --install arm64" | ||
| env: | ||
| ACR_CACHE_PREFIX: "playwright.azurecr.io/cached/" | ||
|
|
||
| - task: Bash@3 | ||
| displayName: "Build & publish Docker images" | ||
| inputs: | ||
| targetType: "inline" | ||
| # The authenticated settings.xml is passed to `docker build` as a secret so | ||
| # that Maven inside the image also resolves from DevDiv_PublicPackages. | ||
| script: MAVEN_SETTINGS_SECRET="$HOME/.m2/settings.xml" ./utils/docker/publish_docker.sh ${{ parameters.releaseChannel }} | ||
| env: | ||
| ACR_CACHE_PREFIX: "playwright.azurecr.io/cached/" | ||
| UBUNTU_MIRROR_PREFIX: "azure." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # The repository root is the Docker build context (see utils/docker/build.sh). | ||
| # Keep registry credentials written by the release pipeline out of the images. | ||
| **/.npmrc | ||
| # Downloaded by publish_docker.sh after the first push. | ||
| utils/docker/oras | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should this include maven secrets as well?
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.
No need — MavenAuthenticate injects credentials into
~/.m2/settings.xmlon the agent, which is outside the build context (repo root), soCOPY .can't pick it up. It reaches the build only via--secretand isn't persisted in any layer..npmrcneeds the entry only because the pipeline writes it into the repo root.