├── .config └── tsaoptions.json ├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github ├── labeler-config.yml ├── linters │ └── .hadolint.yaml └── workflows │ ├── labeler.yml │ ├── linter.yml │ └── run-tests.yml ├── .gitignore ├── CODE-OF-CONDUCT.md ├── CODEOWNERS ├── Directory.Build.props ├── Directory.Packages.props ├── LICENSE ├── NuGet.config ├── README.md ├── build.ps1 ├── eng ├── common │ ├── Dockerfile.WithRepo │ ├── Dockerfile.syft │ ├── Get-BaseImageStatus.ps1 │ ├── Get-ImageBuilder.ps1 │ ├── Get-ImageNameVars.ps1 │ ├── Install-DotNetSdk.ps1 │ ├── Invoke-CleanupDocker.ps1 │ ├── Invoke-ImageBuilder.ps1 │ ├── Invoke-WithRetry.ps1 │ ├── Pull-Image.ps1 │ ├── Retain-Build.ps1 │ ├── build.ps1 │ ├── pull-image.sh │ ├── readme.md │ └── templates │ │ ├── 1es-official.yml │ │ ├── 1es-unofficial.yml │ │ ├── 1es.yml │ │ ├── jobs │ │ ├── build-images.yml │ │ ├── cg-build-projects.yml │ │ ├── copy-base-images-staging.yml │ │ ├── copy-base-images.yml │ │ ├── generate-matrix.yml │ │ ├── post-build.yml │ │ ├── publish.yml │ │ ├── test-images-linux-client.yml │ │ ├── test-images-windows-client.yml │ │ └── validate-image-sizes.yml │ │ ├── stages │ │ ├── build-and-test.yml │ │ ├── dotnet │ │ │ ├── build-and-test.yml │ │ │ ├── build-test-publish-repo.yml │ │ │ ├── publish-config-nonprod.yml │ │ │ ├── publish-config-prod.yml │ │ │ └── publish.yml │ │ ├── publish.yml │ │ └── setup-service-connections.yml │ │ ├── steps │ │ ├── annotate-eol-digests.yml │ │ ├── clean-acr-images.yml │ │ ├── cleanup-docker-linux.yml │ │ ├── cleanup-docker-windows.yml │ │ ├── copy-base-images.yml │ │ ├── download-build-artifact.yml │ │ ├── init-common.yml │ │ ├── init-docker-linux.yml │ │ ├── init-docker-windows.yml │ │ ├── init-matrix-build-publish.yml │ │ ├── parse-test-arg-arrays.yml │ │ ├── publish-artifact.yml │ │ ├── publish-readmes.yml │ │ ├── retain-build.yml │ │ ├── run-imagebuilder.yml │ │ ├── run-pwsh-with-auth.yml │ │ ├── set-dry-run.yml │ │ ├── set-image-info-path-var.yml │ │ ├── test-images-linux-client.yml │ │ ├── test-images-windows-client.yml │ │ ├── validate-branch.yml │ │ ├── validate-image-sizes.yml │ │ ├── wait-for-mcr-doc-ingestion.yml │ │ └── wait-for-mcr-image-ingestion.yml │ │ ├── task-prefix-decorator.yml │ │ └── variables │ │ ├── common-paths.yml │ │ ├── common.yml │ │ ├── docker-images.yml │ │ └── dotnet │ │ ├── build-test-publish.yml │ │ ├── common.yml │ │ ├── secrets-unofficial.yml │ │ └── secrets.yml └── pipelines │ ├── dotnet-buildtools-prereqs-eng.yml │ ├── dotnet-buildtools-prereqs-official.yml │ ├── dotnet-buildtools-prereqs-pr.yml │ ├── dotnet-buildtools-prereqs-unofficial.yml │ ├── stages │ ├── build-test-publish-repo.yml │ └── dotnet-buildtools-prereqs.yml │ ├── steps │ ├── install-cross-build-prereqs.yml │ └── set-base-image-override-options.yml │ └── variables │ └── common.yml ├── es-metadata.yml ├── lifecycle.md ├── manifest.json ├── run-tests.ps1 ├── src ├── almalinux │ ├── 8 │ │ ├── helix │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── source-build │ │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 9 │ │ ├── helix │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── source-build │ │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 10 │ │ ├── helix │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── source-build │ │ │ └── amd64 │ │ │ └── Dockerfile │ └── manifest.json ├── alpine │ ├── 3.19 │ │ ├── WithNode │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 3.20 │ │ └── helix │ │ │ └── Dockerfile │ ├── 3.21 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ └── helix │ │ │ └── Dockerfile │ ├── 3.22 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ └── helix │ │ │ └── Dockerfile │ ├── edge │ │ └── helix │ │ │ └── Dockerfile │ └── manifest.json ├── azurelinux │ ├── 3.0 │ │ ├── docker-testrunner │ │ │ └── Dockerfile │ │ ├── helix │ │ │ └── Dockerfile │ │ ├── net10.0 │ │ │ ├── android │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ └── docker │ │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── build │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── cross │ │ │ │ ├── amd64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── amd64-sanitizer │ │ │ │ │ └── Dockerfile │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── android │ │ │ │ │ ├── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ │ └── openssl │ │ │ │ │ │ └── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── armv6 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── freebsd │ │ │ │ │ └── 14 │ │ │ │ │ │ ├── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ │ │ └── arm64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ ├── loongarch64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── loongarch64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── ppc64le │ │ │ │ │ └── Dockerfile │ │ │ │ ├── riscv64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── riscv64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── s390x │ │ │ │ │ └── Dockerfile │ │ │ │ └── x86 │ │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps-builder │ │ │ │ └── amd64 │ │ │ │ │ ├── Dockerfile │ │ │ │ │ └── dimitri_john_ledkov.asc │ │ │ ├── crossdeps-llvm │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── fpm │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── opt │ │ │ │ └── Dockerfile │ │ │ ├── source-build-test │ │ │ │ └── amd64 │ │ │ │ │ ├── Dockerfile │ │ │ │ │ └── run-scancode.sh │ │ │ └── webassembly │ │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── net8.0 │ │ │ ├── android │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ └── docker │ │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── build │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── cross │ │ │ │ ├── amd64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── android │ │ │ │ │ ├── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ │ └── openssl │ │ │ │ │ │ └── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm64-musl │ │ │ │ │ └── Dockerfile │ │ │ │ ├── arm64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── freebsd │ │ │ │ │ └── 14 │ │ │ │ │ │ └── amd64 │ │ │ │ │ │ └── Dockerfile │ │ │ │ ├── ppc64le │ │ │ │ │ └── Dockerfile │ │ │ │ ├── riscv64 │ │ │ │ │ └── Dockerfile │ │ │ │ ├── s390x │ │ │ │ │ └── Dockerfile │ │ │ │ └── x86 │ │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps-builder │ │ │ │ └── amd64 │ │ │ │ │ ├── Dockerfile │ │ │ │ │ └── dimitri_john_ledkov.asc │ │ │ ├── crossdeps-llvm │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── fpm │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ └── webassembly │ │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── net9.0 │ │ │ ├── android │ │ │ ├── amd64 │ │ │ │ └── Dockerfile │ │ │ └── docker │ │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── build │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── cross │ │ │ ├── amd64-musl │ │ │ │ └── Dockerfile │ │ │ ├── amd64-sanitizer │ │ │ │ └── Dockerfile │ │ │ ├── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── android │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ └── openssl │ │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── arm-musl │ │ │ │ └── Dockerfile │ │ │ ├── arm │ │ │ │ └── Dockerfile │ │ │ ├── arm64-musl │ │ │ │ └── Dockerfile │ │ │ ├── arm64 │ │ │ │ └── Dockerfile │ │ │ ├── armv6 │ │ │ │ └── Dockerfile │ │ │ ├── freebsd │ │ │ │ └── 14 │ │ │ │ │ ├── amd64 │ │ │ │ │ └── Dockerfile │ │ │ │ │ └── arm64 │ │ │ │ │ └── Dockerfile │ │ │ ├── ppc64le │ │ │ │ └── Dockerfile │ │ │ ├── riscv64-musl │ │ │ │ └── Dockerfile │ │ │ ├── riscv64 │ │ │ │ └── Dockerfile │ │ │ ├── s390x │ │ │ │ └── Dockerfile │ │ │ └── x86 │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps-builder │ │ │ └── amd64 │ │ │ │ ├── Dockerfile │ │ │ │ └── dimitri_john_ledkov.asc │ │ │ ├── crossdeps-llvm │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── crossdeps │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── fpm │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── opt │ │ │ └── Dockerfile │ │ │ └── webassembly │ │ │ └── amd64 │ │ │ └── Dockerfile │ └── manifest.json ├── cbl-mariner │ ├── 2.0 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ ├── android │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── cross │ │ │ ├── amd64-alpine │ │ │ │ └── Dockerfile │ │ │ ├── amd64 │ │ │ │ └── Dockerfile │ │ │ ├── android │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ ├── arm-alpine │ │ │ │ └── Dockerfile │ │ │ ├── arm │ │ │ │ └── Dockerfile │ │ │ ├── arm64-alpine │ │ │ │ └── Dockerfile │ │ │ ├── arm64 │ │ │ │ └── Dockerfile │ │ │ └── ubuntu │ │ │ │ └── 18.04 │ │ │ │ ├── amd64 │ │ │ │ └── Dockerfile │ │ │ │ ├── arm │ │ │ │ └── Dockerfile │ │ │ │ └── arm64 │ │ │ │ └── Dockerfile │ │ ├── crossdeps-builder │ │ │ └── amd64 │ │ │ │ ├── Dockerfile │ │ │ │ └── dimitri_john_ledkov.asc │ │ ├── crossdeps-llvm │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── crossdeps │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── fpm │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── helix │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── opt │ │ │ └── arm64 │ │ │ └── Dockerfile │ └── manifest.json ├── centos-stream │ ├── 9 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ ├── helix │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── mlnet │ │ │ └── helix │ │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 10 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ └── helix │ │ │ └── Dockerfile │ └── manifest.json ├── debian │ ├── 11 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ └── helix │ │ │ ├── amd64 │ │ │ └── Dockerfile │ │ │ └── arm64v8 │ │ │ └── Dockerfile │ ├── 12 │ │ ├── gcc15 │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── helix │ │ │ ├── amd64 │ │ │ └── Dockerfile │ │ │ ├── arm32v7 │ │ │ └── Dockerfile │ │ │ └── arm64v8 │ │ │ └── Dockerfile │ ├── 13 │ │ └── helix │ │ │ └── Dockerfile │ └── manifest.json ├── fedora │ ├── 40 │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 41 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ └── helix │ │ │ └── amd64 │ │ │ └── Dockerfile │ ├── 42 │ │ └── helix │ │ │ └── amd64 │ │ │ └── Dockerfile │ └── manifest.json ├── nanoserver │ ├── 1809 │ │ └── helix │ │ │ └── amd64 │ │ │ └── Dockerfile │ └── manifest.json ├── opensuse │ ├── 15.6 │ │ └── helix │ │ │ └── amd64 │ │ │ └── Dockerfile │ └── manifest.json ├── ubuntu │ ├── 22.04 │ │ ├── amd64 │ │ │ └── Dockerfile │ │ ├── coredeps │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── cross │ │ │ └── armel-tizen │ │ │ │ └── Dockerfile │ │ ├── crossdeps │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── debpkg │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ ├── helix │ │ │ ├── Dockerfile │ │ │ ├── sqlserver │ │ │ │ └── amd64 │ │ │ │ │ └── Dockerfile │ │ │ └── webassembly │ │ │ │ └── amd64 │ │ │ │ ├── Dockerfile │ │ │ │ └── setup-node-23.x.sh │ │ ├── mlnet │ │ │ ├── amd64 │ │ │ │ └── Dockerfile │ │ │ └── helix │ │ │ │ └── amd64 │ │ │ │ └── Dockerfile │ │ └── opt │ │ │ └── arm64v8 │ │ │ └── Dockerfile │ ├── 24.04 │ │ ├── Dockerfile │ │ └── helix │ │ │ ├── Dockerfile │ │ │ └── webassembly │ │ │ └── amd64 │ │ │ ├── Dockerfile │ │ │ └── setup-node-23.x.sh │ ├── 25.04 │ │ └── helix │ │ │ └── Dockerfile │ ├── 25.10 │ │ └── helix │ │ │ └── Dockerfile │ ├── build-scripts │ │ └── install-cross-build-prereqs.sh │ └── manifest.json └── windowsservercore │ ├── ltsc2019 │ └── helix │ │ └── amd64 │ │ └── Dockerfile │ ├── ltsc2022 │ └── helix │ │ ├── amd64 │ │ └── Dockerfile │ │ ├── webassembly-net8 │ │ └── amd64 │ │ │ ├── Dockerfile │ │ │ └── arial.ttf │ │ └── webassembly │ │ └── amd64 │ │ ├── Dockerfile │ │ └── arial.ttf │ ├── ltsc2025 │ └── helix │ │ ├── amd64 │ │ └── Dockerfile │ │ ├── webassembly-net8 │ │ └── amd64 │ │ │ ├── Dockerfile │ │ │ └── arial.ttf │ │ └── webassembly │ │ └── amd64 │ │ ├── Dockerfile │ │ └── arial.ttf │ └── manifest.json └── tests └── Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests ├── CodeOwnersTests.cs ├── Config.cs ├── ManifestTests.cs ├── Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests.csproj └── xunit.runner.json /.config/tsaoptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "instanceUrl": "https://devdiv.visualstudio.com/", 3 | "template": "TFSDEVDIV", 4 | "projectName": "DEVDIV", 5 | "areaPath": "DevDiv\\NET Fundamentals\\.NET Acquisition\\Docker", 6 | "iterationPath": "DevDiv", 7 | "notificationAliases": [ "dotnetADTeam@microsoft.com" ], 8 | "repositoryName": "dotnet-buildtools-prereqs-docker", 9 | "codebaseName": "dotnet-buildtools-prereqs-docker" 10 | } 11 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/bin 2 | **/obj 3 | **/out 4 | **/.vscode 5 | **/.vs 6 | .dotnet 7 | .Microsoft.DotNet.ImageBuilder 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | setup-Alpine.sh eol=lf -------------------------------------------------------------------------------- /.github/labeler-config.yml: -------------------------------------------------------------------------------- 1 | # Add 'untriaged' label to any issue that gets opened 2 | untriaged: 3 | - '/.*/' 4 | -------------------------------------------------------------------------------- /.github/linters/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | failure-threshold: error 2 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "Issue Labeler" 2 | on: 3 | issues: 4 | types: [opened] 5 | 6 | permissions: 7 | issues: write 8 | contents: read 9 | 10 | jobs: 11 | triage: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: github/issue-labeler@v3.4 15 | with: 16 | configuration-path: .github/labeler-config.yml 17 | enable-versioned-regex: 0 18 | repo-token: ${{ github.token }} 19 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | name: Lint Code Base 2 | 3 | on: 4 | pull_request: null 5 | 6 | permissions: {} 7 | 8 | jobs: 9 | run-lint: 10 | runs-on: ubuntu-latest 11 | 12 | permissions: 13 | contents: read 14 | packages: read 15 | # To report GitHub Actions status checks 16 | statuses: write 17 | 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v4 21 | with: 22 | # Full git history is needed to get a proper list of changed files within `super-linter` 23 | fetch-depth: 0 24 | - name: Lint Code Base 25 | uses: github/super-linter@v6 # https://github.com/github/super-linter 26 | env: 27 | DEFAULT_BRANCH: main 28 | FILTER_REGEX_EXCLUDE: eng/common/.* 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | VALIDATE_DOCKERFILE_HADOLINT: true 31 | VALIDATE_MARKDOWN: true 32 | -------------------------------------------------------------------------------- /.github/workflows/run-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | run-tests: 9 | name: Run Tests 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out repository code 13 | uses: actions/checkout@v4 14 | 15 | - name: Run Tests 16 | shell: pwsh 17 | run: ./run-tests.ps1 18 | 19 | - name: Upload test results 20 | if: always() 21 | uses: actions/upload-artifact@v4 22 | with: 23 | name: test-results 24 | path: ./artifacts/**/TestResults/* 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build output 2 | [Bb]in/ 3 | [Oo]bj/ 4 | [Oo]ut/ 5 | 6 | # cache for misc downloads 7 | artifacts/ 8 | 9 | # dotnet install directory 10 | .dotnet/ 11 | 12 | # Visual Studio 2015 cache/options directory 13 | .vs/ 14 | 15 | # Visual Studio Code cache/options directory 16 | .vscode/ 17 | 18 | # Visual Studio debug profile 19 | **/launchSettings.json 20 | 21 | # Test files 22 | *.trx 23 | 24 | # User-specific files 25 | *.suo 26 | *.user 27 | 28 | # ImageBuilder directory 29 | .Microsoft.DotNet.ImageBuilder 30 | -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the code of conduct defined by the Contributor Covenant 4 | to clarify expected behavior in our community. 5 | 6 | For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). 7 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | enable 6 | $(MSBuildThisFileDirectory)artifacts\bin\$(Configuration)\$(MSBuildProjectName)\ 7 | $(MSBuildThisFileDirectory) 8 | $(RepoDirectory)src 9 | 10 | 11 | -------------------------------------------------------------------------------- /Directory.Packages.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 .NET Foundation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | [cmdletbinding()] 2 | param( 3 | # Paths to the Dockerfiles to build 4 | [string[]]$Paths, 5 | 6 | # Additional args to pass to ImageBuilder 7 | [string]$OptionalImageBuilderArgs 8 | ) 9 | 10 | Set-StrictMode -Version Latest 11 | $ErrorActionPreference = 'Stop' 12 | pushd $PSScriptRoot 13 | try { 14 | ./eng/common/build.ps1 -Paths $Paths -OptionalImageBuilderArgs $OptionalImageBuilderArgs 15 | } 16 | finally { 17 | popd 18 | } 19 | -------------------------------------------------------------------------------- /eng/common/Dockerfile.WithRepo: -------------------------------------------------------------------------------- 1 | # Use this Dockerfile to create an ImageBuilder image 2 | ARG IMAGE 3 | FROM $IMAGE 4 | 5 | WORKDIR /repo 6 | COPY . . 7 | -------------------------------------------------------------------------------- /eng/common/Dockerfile.syft: -------------------------------------------------------------------------------- 1 | ARG SYFT_IMAGE_NAME 2 | ARG TARGET_IMAGE_NAME 3 | 4 | FROM ${SYFT_IMAGE_NAME} AS syft 5 | FROM ${TARGET_IMAGE_NAME} AS scan-image 6 | 7 | FROM syft AS run-scan 8 | ARG TARGET_IMAGE_NAME 9 | ENV SYFT_CHECK_FOR_APP_UPDATE=0 \ 10 | SYFT_SOURCE_NAME=${TARGET_IMAGE_NAME} 11 | USER root 12 | RUN --mount=from=scan-image,source=/,target=/rootfs \ 13 | ["/syft", "scan", "/rootfs/", "--select-catalogers", "image", "--output", "spdx-json=/manifest.spdx.json"] 14 | 15 | FROM scratch AS output 16 | COPY --from=run-scan /manifest.spdx.json /manifest.spdx.json 17 | -------------------------------------------------------------------------------- /eng/common/Get-BaseImageStatus.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | <# 4 | .SYNOPSIS 5 | Outputs the status of external base images referenced in the Dockerfiles. 6 | #> 7 | [cmdletbinding()] 8 | param( 9 | # Path to the manifest file to use 10 | [string] 11 | $Manifest = "manifest.json", 12 | 13 | # Architecture to filter Dockerfiles to 14 | [string] 15 | $Architecture = "*", 16 | 17 | # A value indicating whether to run the script continously 18 | [switch] 19 | $Continuous, 20 | 21 | # Number of seconds to wait between each iteration 22 | [int] 23 | $ContinuousDelay = 10 24 | ) 25 | 26 | Set-StrictMode -Version Latest 27 | 28 | $imageBuilderArgs = "getBaseImageStatus --manifest $Manifest --architecture $Architecture" 29 | if ($Continuous) { 30 | $imageBuilderArgs += " --continuous --continuous-delay $ContinuousDelay" 31 | } 32 | 33 | & "$PSScriptRoot/Invoke-ImageBuilder.ps1" -ImageBuilderArgs $imageBuilderArgs 34 | -------------------------------------------------------------------------------- /eng/common/Get-ImageBuilder.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | # Load common image names 4 | $imageNameVars = & $PSScriptRoot/Get-ImageNameVars.ps1 5 | foreach ($varName in $imageNameVars.Keys) { 6 | Set-Variable -Name $varName -Value $imageNameVars[$varName] -Scope Global 7 | } 8 | 9 | & docker inspect ${imageNames.imagebuilderName} | Out-Null 10 | if (-not $?) { 11 | Write-Output "Pulling" 12 | & $PSScriptRoot/Invoke-WithRetry.ps1 "docker pull ${imageNames.imagebuilderName}" 13 | } 14 | -------------------------------------------------------------------------------- /eng/common/Get-ImageNameVars.ps1: -------------------------------------------------------------------------------- 1 | # Returns a hashtable of variable name-to-value mapping representing the image name variables 2 | # used by the common build infrastructure. 3 | 4 | $vars = @{} 5 | Get-Content $PSScriptRoot/templates/variables/docker-images.yml | 6 | Where-Object { $_.Trim().Length -gt 0 -and $_.Trim() -notlike 'variables:' -and $_.Trim() -notlike '# *' } | 7 | ForEach-Object { 8 | $parts = $_.Split(':', 2) 9 | $vars[$parts[0].Trim()] = $parts[1].Trim() 10 | } 11 | 12 | return $vars 13 | -------------------------------------------------------------------------------- /eng/common/Install-DotNetSdk.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | # 3 | # Copyright (c) .NET Foundation and contributors. All rights reserved. 4 | # Licensed under the MIT license. See LICENSE file in the project root for full license information. 5 | # 6 | 7 | <# 8 | .SYNOPSIS 9 | Install the .NET Core SDK at the specified path. 10 | 11 | .PARAMETER InstallPath 12 | The path where the .NET Core SDK is to be installed. 13 | 14 | .PARAMETER Channel 15 | The version of the .NET Core SDK to be installed. 16 | 17 | #> 18 | [cmdletbinding()] 19 | param( 20 | [string] 21 | $InstallPath, 22 | [string] 23 | $Channel = "9.0" 24 | ) 25 | 26 | Set-StrictMode -Version Latest 27 | $ErrorActionPreference = 'Stop' 28 | 29 | if (!(Test-Path "$InstallPath")) { 30 | mkdir "$InstallPath" | Out-Null 31 | } 32 | 33 | $IsRunningOnUnix = $PSVersionTable.contains("Platform") -and $PSVersionTable.Platform -eq "Unix" 34 | if ($IsRunningOnUnix) { 35 | $DotnetInstallScript = "dotnet-install.sh" 36 | } 37 | else { 38 | $DotnetInstallScript = "dotnet-install.ps1" 39 | } 40 | 41 | $DotnetInstallScriptPath = Join-Path -Path $InstallPath -ChildPath $DotnetInstallScript 42 | 43 | if (!(Test-Path $DotnetInstallScriptPath)) { 44 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; 45 | & "$PSScriptRoot/Invoke-WithRetry.ps1" "Invoke-WebRequest 'https://builds.dotnet.microsoft.com/dotnet/scripts/v1/$DotnetInstallScript' -OutFile $DotnetInstallScriptPath" 46 | } 47 | 48 | $DotnetChannel = $Channel 49 | 50 | $InstallFailed = $false 51 | if ($IsRunningOnUnix) { 52 | & chmod +x $DotnetInstallScriptPath 53 | & "$PSScriptRoot/Invoke-WithRetry.ps1" "$DotnetInstallScriptPath --channel $DotnetChannel --install-dir $InstallPath" -Retries 5 54 | $InstallFailed = ($LASTEXITCODE -ne 0) 55 | } 56 | else { 57 | & "$PSScriptRoot/Invoke-WithRetry.ps1" "$DotnetInstallScriptPath -Channel $DotnetChannel -InstallDir $InstallPath" -Retries 5 58 | $InstallFailed = (-not $?) 59 | } 60 | 61 | # See https://github.com/NuGet/NuGet.Client/pull/4259 62 | $Env:NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY = "6,1500" 63 | 64 | if ($InstallFailed) { throw "Failed to install the .NET Core SDK" } 65 | -------------------------------------------------------------------------------- /eng/common/Invoke-CleanupDocker.ps1: -------------------------------------------------------------------------------- 1 | Set-StrictMode -Version Latest 2 | $ErrorActionPreference = 'Stop' 3 | 4 | docker ps -a -q | ForEach-Object { docker rm -f $_ } 5 | 6 | docker volume prune -f 7 | 8 | # Preserve the tagged Windows base images and the common eng infra images (e.g. ImageBuilder) 9 | # to avoid the expense of having to repull continuously. 10 | $imageNameVars = & $PSScriptRoot/Get-ImageNameVars.ps1 11 | 12 | docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | 13 | Where-Object { 14 | $localImage = $_ 15 | $localImage.Contains(": ")` 16 | -Or -Not ($localImage.StartsWith("mcr.microsoft.com/windows")` 17 | -Or ($imageNameVars.Values.Where({ $localImage.StartsWith($_) }, 'First').Count -gt 0)) } | 18 | ForEach-Object { $_.Split(' ', [System.StringSplitOptions]::RemoveEmptyEntries)[1] } | 19 | Select-Object -Unique | 20 | ForEach-Object { docker rmi -f $_ } 21 | -------------------------------------------------------------------------------- /eng/common/Invoke-WithRetry.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | # Executes a command and retries if it fails. 4 | [cmdletbinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)][string]$Cmd, 7 | [int]$Retries = 2, 8 | [int]$WaitFactor = 6 9 | ) 10 | 11 | Set-StrictMode -Version Latest 12 | $ErrorActionPreference = 'Stop' 13 | 14 | $count = 0 15 | $completed = $false 16 | 17 | Write-Output "Executing '$Cmd'" 18 | 19 | while (-not $completed) { 20 | try { 21 | Invoke-Expression $Cmd 22 | if (-not $(Test-Path variable:LASTEXITCODE) -or $LASTEXITCODE -eq 0) { 23 | $completed = $true 24 | continue 25 | } 26 | } 27 | catch { 28 | } 29 | 30 | $count++ 31 | 32 | if ($count -lt $Retries) { 33 | $wait = [Math]::Pow($WaitFactor, $count - 1) 34 | Write-Output "Retry $count/$Retries, retrying in $wait seconds..." 35 | Start-Sleep $wait 36 | } 37 | else { 38 | Write-Output "Retry $count/$Retries, no more retries left." 39 | throw "Failed to execute '$Cmd'" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /eng/common/Pull-Image.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | [cmdletbinding()] 4 | param( 5 | [Parameter(Mandatory = $true, Position = 0)] 6 | [string]$Image, 7 | 8 | [Parameter(Mandatory = $false)] 9 | [int]$Retries = 2, 10 | 11 | [Parameter(Mandatory = $false)] 12 | [int]$WaitFactor = 6 13 | ) 14 | 15 | Set-StrictMode -Version Latest 16 | $ErrorActionPreference = 'Stop' 17 | 18 | & "$PSScriptRoot/Invoke-WithRetry.ps1" "docker pull $Image" -Retries $Retries -WaitFactor $WaitFactor 19 | -------------------------------------------------------------------------------- /eng/common/Retain-Build.ps1: -------------------------------------------------------------------------------- 1 | # Adapted from https://github.com/dotnet/arcade/blob/main/eng/common/retain-build.ps1 2 | Param( 3 | [Parameter(Mandatory = $true)][int] $BuildId, 4 | [Parameter(Mandatory = $true)][string] $AzdoOrgUri, 5 | [Parameter(Mandatory = $true)][string] $AzdoProject, 6 | [Parameter(Mandatory = $true)][string] $Token 7 | ) 8 | 9 | $ErrorActionPreference = 'Stop' 10 | Set-StrictMode -Version 2.0 11 | 12 | function Get-AzDOHeaders( 13 | [string] $Token) { 14 | $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${Token}")) 15 | $headers = @{"Authorization" = "Basic $base64AuthInfo" } 16 | return $headers 17 | } 18 | 19 | function Update-BuildRetention( 20 | [string] $AzdoOrgUri, 21 | [string] $AzdoProject, 22 | [int] $BuildId, 23 | [string] $Token) { 24 | $headers = Get-AzDOHeaders -Token $Token 25 | $requestBody = "{ 26 | `"keepForever`": `"true`" 27 | }" 28 | 29 | $requestUri = "${AzdoOrgUri}/${AzdoProject}/_apis/build/builds/${BuildId}?api-version=6.0" 30 | Write-Host "Attempting to retain build using the following URI: ${requestUri} ..." 31 | 32 | try { 33 | Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" 34 | Write-Host "Updated retention settings for build ${BuildId}." 35 | } 36 | catch { 37 | Write-Host "##[error] Failed to update retention settings for build: $($_.Exception.Response.StatusDescription)" 38 | exit 1 39 | } 40 | } 41 | 42 | Update-BuildRetention -AzdoOrgUri $AzdoOrgUri -AzdoProject $AzdoProject -BuildId $BuildId -Token $Token 43 | exit 0 44 | -------------------------------------------------------------------------------- /eng/common/build.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | <# 4 | .SYNOPSIS 5 | Builds the Dockerfiles 6 | #> 7 | 8 | [cmdletbinding()] 9 | param( 10 | # Product versions to filter by 11 | [string[]]$Version = "*", 12 | 13 | # Names of OS to filter by 14 | [string[]]$OS, 15 | 16 | # Type of architecture to filter by 17 | [string]$Architecture, 18 | 19 | # Additional custom path filters 20 | [string[]]$Paths, 21 | 22 | # Path to manifest file 23 | [string]$Manifest = "manifest.json", 24 | 25 | # Additional args to pass to ImageBuilder 26 | [string]$OptionalImageBuilderArgs 27 | ) 28 | 29 | Set-StrictMode -Version Latest 30 | $ErrorActionPreference = 'Stop' 31 | 32 | function Log { 33 | param ([string] $Message) 34 | 35 | Write-Output $Message 36 | } 37 | 38 | function Exec { 39 | param ([string] $Cmd) 40 | 41 | Log "Executing: '$Cmd'" 42 | Invoke-Expression $Cmd 43 | if ($LASTEXITCODE -ne 0) { 44 | throw "Failed: '$Cmd'" 45 | } 46 | } 47 | 48 | pushd $PSScriptRoot/../.. 49 | try { 50 | $args = $OptionalImageBuilderArgs 51 | 52 | if ($Version) { 53 | $args += ($Version | foreach { ' --version "{0}"' -f $_ }) 54 | } 55 | 56 | if ($OS) { 57 | $args += ($OS | foreach { ' --os-version "{0}"' -f $_ }) 58 | } 59 | 60 | if ($Architecture) { 61 | $args += ' --architecture "{0}"' -f $Architecture 62 | } 63 | 64 | if ($Paths) { 65 | $args += ($Paths | foreach { ' --path "{0}"' -f $_ }) 66 | } 67 | 68 | if ($Manifest) { 69 | $args += ' --manifest "{0}"' -f $Manifest 70 | } 71 | 72 | ./eng/common/Invoke-ImageBuilder.ps1 "build $args" 73 | } 74 | finally { 75 | popd 76 | } 77 | -------------------------------------------------------------------------------- /eng/common/pull-image.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Stop script on NZEC 4 | set -e 5 | # Stop script if unbound variable found (use ${var:-} if intentional) 6 | set -u 7 | 8 | say_err() { 9 | printf "%b\n" "Error: $1" >&2 10 | } 11 | 12 | # Executes a command and retries if it fails. 13 | execute() { 14 | local count=0 15 | until "$@"; do 16 | local exit=$? 17 | count=$(( $count + 1 )) 18 | if [ $count -lt $retries ]; then 19 | local wait=$(( waitFactor ** (( count - 1 )) )) 20 | echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." 21 | sleep $wait 22 | else 23 | say_err "Retry $count/$retries exited $exit, no more retries left." 24 | return $exit 25 | fi 26 | done 27 | 28 | return 0 29 | } 30 | 31 | scriptName=$0 32 | retries=5 33 | waitFactor=6 34 | image=$1 35 | 36 | echo "Pulling Docker image $image" 37 | execute docker pull $image 38 | -------------------------------------------------------------------------------- /eng/common/readme.md: -------------------------------------------------------------------------------- 1 | # Don't touch this folder 2 | 3 | uuuuuuuuuuuuuuuuuuuu 4 | u" uuuuuuuuuuuuuuuuuu "u 5 | u" u$$$$$$$$$$$$$$$$$$$$u "u 6 | u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u 7 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 8 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 9 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 10 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 11 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 12 | $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ 13 | $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ 14 | $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ 15 | $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ 16 | $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ 17 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 18 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 19 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 20 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 21 | "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" 22 | "u "$$$$$$$$$$$$$$$$$$$$" u" 23 | "u """""""""""""""""" u" 24 | """""""""""""""""""" 25 | 26 | !!! Changes made in this directory are subject to being overwritten by automation !!! 27 | 28 | The files in this directory are shared by all .NET Docker repos. If you need to make changes to these files, open an issue or submit a pull request in https://github.com/dotnet/docker-tools. -------------------------------------------------------------------------------- /eng/common/templates/jobs/copy-base-images-staging.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: name 3 | type: string 4 | default: null 5 | - name: pool 6 | type: object 7 | default: {} 8 | - name: publishConfig 9 | type: object 10 | default: null 11 | - name: customInitSteps 12 | type: stepList 13 | default: [] 14 | - name: additionalOptions 15 | type: string 16 | default: '' 17 | - name: continueOnError 18 | type: string 19 | default: false 20 | 21 | jobs: 22 | - template: /eng/common/templates/jobs/copy-base-images.yml@self 23 | parameters: 24 | name: ${{ parameters.name }} 25 | pool: ${{ parameters.pool }} 26 | customInitSteps: ${{ parameters.customInitSteps }} 27 | additionalOptions: ${{ parameters.additionalOptions }} 28 | acr: ${{ parameters.publishConfig.internalMirrorAcr }} 29 | repoPrefix: ${{ parameters.publishConfig.internalMirrorAcr.repoPrefix }} 30 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/copy-base-images.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: name 3 | type: string 4 | default: null 5 | - name: pool 6 | type: object 7 | default: {} 8 | - name: acr 9 | type: object 10 | default: null 11 | - name: repoPrefix 12 | type: string 13 | default: null 14 | - name: customInitSteps 15 | type: stepList 16 | default: [] 17 | - name: additionalOptions 18 | type: string 19 | default: '' 20 | - name: continueOnError 21 | type: string 22 | default: false 23 | - name: forceDryRun 24 | type: boolean 25 | default: false 26 | 27 | jobs: 28 | - job: ${{ parameters.name }} 29 | pool: ${{ parameters.pool }} 30 | steps: 31 | - template: /eng/common/templates/steps/init-docker-linux.yml@self 32 | - ${{ parameters.customInitSteps }} 33 | - template: /eng/common/templates/steps/copy-base-images.yml@self 34 | parameters: 35 | acr: ${{ parameters.acr }} 36 | repoPrefix: ${{ parameters.repoPrefix }} 37 | additionalOptions: ${{ parameters.additionalOptions }} 38 | continueOnError: ${{ parameters.continueOnError }} 39 | forceDryRun: ${{ parameters.forceDryRun }} 40 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/test-images-linux-client.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | name: null 3 | pool: {} 4 | matrix: {} 5 | testJobTimeout: 60 6 | preBuildValidation: false 7 | internalProjectName: null 8 | publishConfig: null 9 | customInitSteps: [] 10 | sourceBuildPipelineRunId: "" 11 | 12 | jobs: 13 | - job: ${{ parameters.name }} 14 | ${{ if eq(parameters.preBuildValidation, 'false') }}: 15 | condition: and(succeeded(), ${{ parameters.matrix }}) 16 | dependsOn: GenerateTestMatrix 17 | strategy: 18 | matrix: $[ ${{ parameters.matrix }} ] 19 | ${{ if eq(parameters.preBuildValidation, 'true') }}: 20 | condition: and(succeeded(), ne(variables.testScriptPath, '')) 21 | pool: ${{ parameters.pool }} 22 | timeoutInMinutes: ${{ parameters.testJobTimeout }} 23 | steps: 24 | - template: /eng/common/templates/steps/test-images-linux-client.yml@self 25 | parameters: 26 | preBuildValidation: ${{ parameters.preBuildValidation }} 27 | internalProjectName: ${{ parameters.internalProjectName }} 28 | publishConfig: ${{ parameters.publishConfig }} 29 | customInitSteps: ${{ parameters.customInitSteps }} 30 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 31 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/test-images-windows-client.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | name: null 3 | pool: {} 4 | matrix: {} 5 | testJobTimeout: 60 6 | internalProjectName: null 7 | publishConfig: null 8 | customInitSteps: [] 9 | sourceBuildPipelineRunId: "" 10 | 11 | jobs: 12 | - job: ${{ parameters.name }} 13 | condition: and(succeeded(), ${{ parameters.matrix }}) 14 | dependsOn: GenerateTestMatrix 15 | pool: ${{ parameters.pool }} 16 | strategy: 17 | matrix: $[ ${{ parameters.matrix }} ] 18 | timeoutInMinutes: ${{ parameters.testJobTimeout }} 19 | steps: 20 | - template: /eng/common/templates/steps/test-images-windows-client.yml@self 21 | parameters: 22 | internalProjectName: ${{ parameters.internalProjectName }} 23 | publishConfig: ${{ parameters.publishConfig }} 24 | customInitSteps: ${{ parameters.customInitSteps }} 25 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 26 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/validate-image-sizes.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | internalProjectName: null 3 | publicProjectName: null 4 | 5 | jobs: 6 | - ${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}: 7 | # Split the Linux images into separate jobs in order to compensate for less 8 | # disk space on the Linux agents. See https://github.com/dotnet/dotnet-docker/issues/1588 9 | - job: LinuxAmd64PerfTests 10 | pool: 11 | vmImage: $(defaultLinuxAmd64PoolImage) 12 | workspace: 13 | clean: all 14 | steps: 15 | - template: ../steps/validate-image-sizes.yml 16 | parameters: 17 | dockerClientOS: linux 18 | architecture: amd64 19 | validationMode: size 20 | - job: LinuxArmPerfTests 21 | pool: 22 | vmImage: $(defaultLinuxAmd64PoolImage) 23 | workspace: 24 | clean: all 25 | steps: 26 | - template: ../steps/validate-image-sizes.yml 27 | parameters: 28 | dockerClientOS: linux 29 | architecture: arm* 30 | validationMode: size 31 | - job: LinuxBaselineIntegrityPerfTests 32 | pool: 33 | vmImage: $(defaultLinuxAmd64PoolImage) 34 | workspace: 35 | clean: all 36 | steps: 37 | - template: ../steps/validate-image-sizes.yml 38 | parameters: 39 | dockerClientOS: linux 40 | validationMode: integrity 41 | - job: WindowsPerfTests 42 | pool: Docker-2022-${{ variables['System.TeamProject'] }} 43 | workspace: 44 | clean: all 45 | steps: 46 | - template: ../steps/validate-image-sizes.yml 47 | parameters: 48 | dockerClientOS: windows 49 | ${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}: 50 | validationMode: integrity 51 | -------------------------------------------------------------------------------- /eng/common/templates/stages/setup-service-connections.yml: -------------------------------------------------------------------------------- 1 | # This stage exists to tell Azure DevOps about all of the service connections 2 | # that will be used in the pipeline. A service connection will not work unless 3 | # it is declared in this stage's parameters, even if your pipeline has already 4 | # been granted access to the service connection. This stage also does not need 5 | # to complete before the service connection is used. 6 | parameters: 7 | - name: pool 8 | type: object 9 | default: 10 | name: $(default1ESInternalPoolName) 11 | image: $(default1ESInternalPoolImage) 12 | os: linux 13 | # serviceConnections object shape: 14 | # - name: string 15 | - name: serviceConnections 16 | type: object 17 | default: [] 18 | 19 | stages: 20 | 21 | - stage: SetupServiceConnectionsStage 22 | displayName: Setup service connections 23 | jobs: 24 | 25 | - job: SetupServiceConnectionsJob 26 | displayName: Setup service connections 27 | pool: ${{ parameters.pool }} 28 | steps: 29 | - checkout: none 30 | - ${{ each serviceConnection in parameters.serviceConnections }}: 31 | - task: AzureCLI@2 32 | displayName: Setup ${{ serviceConnection.name }} 33 | inputs: 34 | azureSubscription: ${{ serviceConnection.name }} 35 | scriptType: pscore 36 | scriptLocation: inlineScript 37 | inlineScript: | 38 | az account show 39 | -------------------------------------------------------------------------------- /eng/common/templates/steps/annotate-eol-digests.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishConfig 3 | type: object 4 | # Path to EOL annotation data JSON file generated by 'generateEolAnnotationData*' command 5 | - name: dataFile 6 | type: string 7 | 8 | steps: 9 | - script: mkdir -p $(Build.ArtifactStagingDirectory)/annotation-digests 10 | displayName: Create Annotation Digests Directory 11 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 12 | parameters: 13 | name: AnnotateEOLImages 14 | displayName: Annotate EOL Images 15 | serviceConnections: 16 | - name: acr 17 | id: ${{ parameters.publishConfig.publishAcr.serviceConnection.id }} 18 | tenantId: ${{ parameters.publishConfig.publishAcr.serviceConnection.tenantId }} 19 | clientId: ${{ parameters.publishConfig.publishAcr.serviceConnection.clientId }} 20 | internalProjectName: internal 21 | condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true')) 22 | args: >- 23 | annotateEolDigests 24 | ${{ parameters.dataFile }} 25 | ${{ parameters.publishConfig.publishAcr.server }} 26 | ${{ parameters.publishConfig.publishAcr.repoPrefix }} 27 | $(artifactsPath)/annotation-digests/annotation-digests.txt 28 | $(dryRunArg) 29 | - template: /eng/common/templates/steps/publish-artifact.yml@self 30 | parameters: 31 | path: $(Build.ArtifactStagingDirectory)/annotation-digests 32 | artifactName: annotation-digests-$(System.JobAttempt) 33 | displayName: Publish Annotation Digests List 34 | internalProjectName: internal 35 | publicProjectName: public 36 | condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true')) 37 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 38 | parameters: 39 | displayName: Wait for Annotation Ingestion 40 | serviceConnections: 41 | - name: mar 42 | id: $(marStatus.serviceConnection.id) 43 | tenantId: $(marStatus.serviceConnection.tenantId) 44 | clientId: $(marStatus.serviceConnection.clientId) 45 | internalProjectName: internal 46 | condition: and(succeeded(), eq(variables['publishEolAnnotations'], 'true'), eq(variables['waitForIngestionEnabled'], 'true')) 47 | args: >- 48 | waitForMarAnnotationIngestion 49 | $(artifactsPath)/annotation-digests/annotation-digests.txt 50 | -------------------------------------------------------------------------------- /eng/common/templates/steps/clean-acr-images.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | repo: null 3 | subscription: null 4 | resourceGroup: null 5 | acr: null 6 | action: null 7 | age: null 8 | customArgs: "" 9 | internalProjectName: null 10 | steps: 11 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 12 | parameters: 13 | displayName: Clean ACR Images - ${{ parameters.repo }} 14 | serviceConnections: 15 | - name: acr 16 | id: $(clean.serviceConnection.id) 17 | tenantId: $(clean.serviceConnection.tenantId) 18 | clientId: $(clean.serviceConnection.clientId) 19 | internalProjectName: ${{ parameters.internalProjectName }} 20 | args: >- 21 | cleanAcrImages 22 | ${{ parameters.repo }} 23 | ${{ parameters.subscription }} 24 | ${{ parameters.resourceGroup }} 25 | ${{ parameters.acr }} 26 | --action ${{ parameters.action }} 27 | --age ${{ parameters.age }} 28 | ${{ parameters.customArgs }} 29 | -------------------------------------------------------------------------------- /eng/common/templates/steps/cleanup-docker-linux.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | condition: true 3 | 4 | steps: 5 | ################################################################################ 6 | # Cleanup local Docker server 7 | ################################################################################ 8 | - script: docker stop $(docker ps -q) || true 9 | displayName: Stop Running Containers 10 | condition: and(always(), ${{ parameters.condition }}) 11 | continueOnError: true 12 | - script: docker system prune -a -f --volumes 13 | displayName: Cleanup Docker 14 | condition: and(always(), ${{ parameters.condition }}) 15 | continueOnError: true 16 | -------------------------------------------------------------------------------- /eng/common/templates/steps/cleanup-docker-windows.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | condition: true 3 | 4 | steps: 5 | ################################################################################ 6 | # Cleanup Docker Resources 7 | ################################################################################ 8 | - powershell: $(engCommonPath)/Invoke-CleanupDocker.ps1 9 | displayName: Cleanup Docker Images 10 | condition: and(always(), ${{ parameters.condition }}) 11 | continueOnError: true 12 | - powershell: | 13 | if (Test-Path $(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder) { 14 | Remove-Item $(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder -Force -Recurse; 15 | } 16 | displayName: Cleanup Image Builder 17 | condition: and(always(), ${{ parameters.condition }}) 18 | continueOnError: true 19 | -------------------------------------------------------------------------------- /eng/common/templates/steps/copy-base-images.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: acr 3 | type: object 4 | default: 5 | server: "" 6 | serviceConnection: 7 | tenantId: "" 8 | clientId: "" 9 | id: "" 10 | subscription: "" 11 | resourceGroup: "" 12 | - name: repoPrefix 13 | type: string 14 | default: null 15 | - name: additionalOptions 16 | type: string 17 | default: "" 18 | - name: continueOnError 19 | type: string 20 | default: false 21 | - name: forceDryRun 22 | type: boolean 23 | default: false 24 | 25 | steps: 26 | - ${{ if or(eq(parameters.forceDryRun, true), eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: 27 | - script: echo "##vso[task.setvariable variable=dryRunArg]--dry-run" 28 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 29 | parameters: 30 | displayName: Copy Base Images 31 | serviceConnections: 32 | - name: "acr" 33 | tenantId: ${{ parameters.acr.serviceConnection.tenantId }} 34 | clientId: ${{ parameters.acr.serviceConnection.clientId }} 35 | id: ${{ parameters.acr.serviceConnection.id }} 36 | continueOnError: ${{ parameters.continueOnError }} 37 | internalProjectName: 'internal' 38 | # Use environment variable to reference $(dryRunArg). Since $(dryRunArg) might be undefined, 39 | # PowerShell will treat the Azure Pipelines variable macro syntax as a command and throw an 40 | # error 41 | args: >- 42 | copyBaseImages 43 | '${{ parameters.acr.subscription }}' 44 | '${{ parameters.acr.resourceGroup }}' 45 | $(dockerHubRegistryCreds) 46 | $(customCopyBaseImagesArgs) 47 | --repo-prefix '${{ parameters.repoPrefix }}' 48 | --registry-override '${{ parameters.acr.server }}' 49 | --os-type 'linux' 50 | --architecture '*' 51 | $env:DRYRUNARG 52 | ${{ parameters.additionalOptions }} 53 | -------------------------------------------------------------------------------- /eng/common/templates/steps/download-build-artifact.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # Destination directory on the pipeline agent's filesystem, relative or absolute. 3 | targetPath: "" 4 | # The build/pipeline artifact to download. If the value is left empty, 5 | # the task downloads all artifacts associated with the pipeline run. 6 | artifactName: "" 7 | # AKA pipeline/definition - optional. 8 | # If this is left empty, use the current pipeline's definition ID. 9 | # You can get this from the URL of the pipeline's overview page on Azure DevOps. 10 | # Example: https://dev.azure.com/$org/$project/_build?definitionId=373 11 | pipelineDefinitionId: "" 12 | # AKA runId/buildId/pipelineId - optional. 13 | # The identifier of the pipeline run from which to download the artifacts. 14 | # If this is left empty, then always download from the current pipeline 15 | # You can get this from the URL of the specific pipeline run, for example: 16 | # https://dev.azure.com/$org/$project/_build/results?buildId=2709155&view=results 17 | pipelineRunId: "" 18 | condition: true 19 | continueOnError: false 20 | 21 | steps: 22 | # https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/download-pipeline-artifact-v2 23 | - task: DownloadPipelineArtifact@2 24 | inputs: 25 | ${{ if ne(parameters.pipelineRunId, '') }}: 26 | buildType: specific 27 | project: $(System.TeamProject) 28 | ${{ if ne(parameters.pipelineDefinitionId, '') }}: 29 | definition: ${{ parameters.pipelineDefinitionId }} 30 | ${{ else }}: 31 | definition: $(System.DefinitionId) 32 | buildId: ${{ parameters.pipelineRunId }} 33 | buildVersionToDownload: specific 34 | ${{ else }}: 35 | buildType: current 36 | targetPath: ${{ parameters.targetPath }} 37 | artifactName: ${{ parameters.artifactName }} 38 | displayName: Download Build Artifact(s) 39 | condition: and(succeeded(), ${{ parameters.condition }}) 40 | continueOnError: ${{ parameters.continueOnError }} 41 | -------------------------------------------------------------------------------- /eng/common/templates/steps/init-common.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | condition: true 3 | 4 | steps: 5 | - powershell: | 6 | $sourceBranch=$Env:BUILD_SOURCEBRANCH -replace "refs/heads/","" -replace "refs/tags/","" -replace "refs/pull/","" 7 | echo "##vso[task.setvariable variable=sourceBranch]$sourceBranch" 8 | displayName: Define Source Branch Variable 9 | condition: and(succeeded(), ${{ parameters.condition }}) 10 | -------------------------------------------------------------------------------- /eng/common/templates/steps/init-docker-windows.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | setupImageBuilder: true 3 | condition: true 4 | 5 | steps: 6 | - template: /eng/common/templates/steps/init-common.yml@self 7 | parameters: 8 | condition: ${{ parameters.condition }} 9 | - powershell: echo "##vso[task.setvariable variable=artifactsPath]$(Build.ArtifactStagingDirectory)" 10 | displayName: Define Artifacts Path Variable 11 | condition: and(succeeded(), ${{ parameters.condition }}) 12 | 13 | ################################################################################ 14 | # Cleanup Docker Resources 15 | ################################################################################ 16 | - template: /eng/common/templates/steps/cleanup-docker-windows.yml@self 17 | parameters: 18 | condition: ${{ parameters.condition }} 19 | 20 | ################################################################################ 21 | # Setup Image Builder (Optional) 22 | ################################################################################ 23 | - ${{ if eq(parameters.setupImageBuilder, 'true') }}: 24 | - powershell: $(engCommonPath)/Invoke-WithRetry.ps1 "docker pull $(imageNames.imageBuilder)" 25 | displayName: Pull Image Builder 26 | condition: and(succeeded(), ${{ parameters.condition }}) 27 | - script: docker create --name setupImageBuilder-$(Build.BuildId)-$(System.JobId) $(imageNames.imageBuilder) 28 | displayName: Create Setup Container 29 | condition: and(succeeded(), ${{ parameters.condition }}) 30 | - script: > 31 | docker cp 32 | setupImageBuilder-$(Build.BuildId)-$(System.JobId):/image-builder 33 | $(Build.BinariesDirectory)/.Microsoft.DotNet.ImageBuilder 34 | displayName: Copy Image Builder 35 | condition: and(succeeded(), ${{ parameters.condition }}) 36 | - script: docker rm -f setupImageBuilder-$(Build.BuildId)-$(System.JobId) 37 | displayName: Cleanup Setup Container 38 | condition: and(always(), ${{ parameters.condition }}) 39 | continueOnError: true 40 | - task: PowerShell@2 41 | displayName: Define runImageBuilderCmd Variables 42 | condition: and(succeeded(), ${{ parameters.condition }}) 43 | inputs: 44 | targetType: 'inline' 45 | script: | 46 | $runImageBuilderCmd = "$(Build.BinariesDirectory)\.Microsoft.DotNet.ImageBuilder\Microsoft.DotNet.ImageBuilder.exe" 47 | Write-Host "##vso[task.setvariable variable=runImageBuilderCmd]$runImageBuilderCmd" 48 | Write-Host "##vso[task.setvariable variable=runAuthedImageBuilderCmd]$runImageBuilderCmd" 49 | -------------------------------------------------------------------------------- /eng/common/templates/steps/parse-test-arg-arrays.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - powershell: | 3 | # Formats the OS versions in a compact human-readable form (e.g. "os1/os2") 4 | $osVersionsDisplayName = '$(osVersions)' -Replace '--os-version ', '' -Replace ' ', '/' 5 | 6 | # Defines a PowerShell snippet in string-form that can be used to initialize an array of the OS versions 7 | $osVersionsArrayInitStr = "@('" + $($osVersionsDisplayName -Replace "/", "', '") + "')" 8 | 9 | echo "##vso[task.setvariable variable=osVersionsDisplayName]$osVersionsDisplayName" 10 | echo "##vso[task.setvariable variable=osVersionsArrayInitStr]$osVersionsArrayInitStr" 11 | 12 | # Defines a PowerShell snippet in string-form that can be used to initialize an array of the image builder paths 13 | $pathInitStr = "@('" + $('$(imageBuilderPaths)' -Replace '--path', '' -Replace " ", "', '") + "')" 14 | echo "##vso[task.setvariable variable=imageBuilderPathsArrayInitStr]$pathInitStr" 15 | displayName: Parse Test Arg Arrays 16 | -------------------------------------------------------------------------------- /eng/common/templates/steps/publish-artifact.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: path 3 | type: string 4 | - name: artifactName 5 | type: string 6 | - name: displayName 7 | type: string 8 | - name: internalProjectName 9 | type: string 10 | - name: publicProjectName 11 | type: string 12 | - name: condition 13 | type: string 14 | default: 'true' 15 | 16 | steps: 17 | - ${{ if eq(variables['System.TeamProject'], parameters.internalProjectName) }}: 18 | - task: 1ES.PublishPipelineArtifact@1 19 | inputs: 20 | path: ${{ parameters.path }} 21 | artifact: ${{ parameters.artifactName }} 22 | displayName: ${{ parameters.displayName }} 23 | condition: and(succeeded(), ${{ parameters.condition }}) 24 | - ${{ if eq(variables['System.TeamProject'], parameters.publicProjectName) }}: 25 | - publish: ${{ parameters.path }} 26 | artifact: ${{ parameters.artifactName }} 27 | displayName: ${{ parameters.displayName }} 28 | condition: and(succeeded(), ${{ parameters.condition }}) 29 | -------------------------------------------------------------------------------- /eng/common/templates/steps/publish-readmes.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | dryRunArg: "" 3 | condition: true 4 | 5 | steps: 6 | - script: > 7 | $(runImageBuilderCmd) publishMcrDocs 8 | --manifest '$(manifest)' 9 | --registry-override '${{ parameters.publishConfig.publishAcr.server }}' 10 | '$(mcrDocsRepoInfo.userName)' 11 | '$(mcrDocsRepoInfo.email)' 12 | $(mcrDocsRepoInfo.authArgs) 13 | '$(publicGitRepoUri)' 14 | ${{ parameters.dryRunArg }} 15 | $(manifestVariables) 16 | $(imageBuilder.queueArgs) 17 | --git-owner 'Microsoft' 18 | --git-repo 'mcrdocs' 19 | --git-branch 'main' 20 | --git-path 'teams' 21 | $(additionalPublishMcrDocsArgs) 22 | name: PublishReadmes 23 | displayName: Publish Readmes 24 | condition: ${{ parameters.condition }} 25 | - template: /eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml@self 26 | parameters: 27 | commitDigest: $(PublishReadmes.readmeCommitDigest) 28 | condition: and(${{ parameters.condition }}, ne(variables['PublishReadmes.readmeCommitDigest'], '')) 29 | dryRunArg: ${{ parameters.dryRunArg }} 30 | -------------------------------------------------------------------------------- /eng/common/templates/steps/retain-build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - powershell: > 3 | $(engCommonPath)/Retain-Build.ps1 4 | -BuildId $(Build.BuildId) 5 | -AzdoOrgUri '$(System.CollectionUri)' 6 | -AzdoProject '$(System.TeamProject)' 7 | -Token '$(System.AccessToken)' 8 | displayName: Enable permanent build retention 9 | condition: and(succeeded(), eq(variables.retainBuild, 'true')) 10 | -------------------------------------------------------------------------------- /eng/common/templates/steps/run-pwsh-with-auth.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: name 3 | type: string 4 | default: "" 5 | - name: displayName 6 | type: string 7 | default: "Run PowerShell" 8 | - name: serviceConnection 9 | type: string 10 | default: "" 11 | - name: command 12 | type: string 13 | default: null 14 | - name: continueOnError 15 | type: boolean 16 | default: false 17 | - name: dockerClientOS 18 | type: string 19 | default: "linux" 20 | - name: condition 21 | type: string 22 | default: true 23 | 24 | steps: 25 | - task: AzureCLI@2 26 | ${{ if ne(parameters.name, '') }}: 27 | name: ${{ parameters.name }} 28 | displayName: ${{ parameters.displayName }} (Authenticated) 29 | continueOnError: ${{ parameters.continueOnError }} 30 | condition: and(succeeded(), ${{ parameters.condition }}) 31 | inputs: 32 | azureSubscription: ${{ parameters.serviceConnection }} 33 | addSpnToEnvironment: true 34 | ${{ if eq(parameters.dockerClientOS, 'windows') }}: 35 | scriptType: 'ps' 36 | ${{ else }}: 37 | scriptType: 'pscore' 38 | scriptLocation: 'inlineScript' 39 | inlineScript: ${{ parameters.command }}; 40 | -------------------------------------------------------------------------------- /eng/common/templates/steps/set-dry-run.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | name: publishConfig 3 | type: object 4 | 5 | steps: 6 | - powershell: | 7 | if ("$env:ONEESPT_BUILDTYPE" -eq "Unofficial") 8 | { 9 | # Don't use dry-run mode for unofficial builds, since they publish to a 10 | # non-production environment 11 | $dryRunArg="" 12 | } 13 | elseif ("$(System.TeamProject)" -eq "$(publicProjectName)") 14 | { 15 | # Public builds need to use dry-run mode since they don't publish anywhere. 16 | $dryRunArg="--dry-run" 17 | } 18 | elseif (-not "$(officialRepoPrefixes)".Split(',').Contains("${{ parameters.publishConfig.publishAcr.repoPrefix }}")) 19 | { 20 | # If we're running an internal build on an official pipeline but not 21 | # publishing to an official repo prefix, then use dry run mode. 22 | $dryRunArg="--dry-run" 23 | } 24 | else 25 | { 26 | $dryRunArg="" 27 | } 28 | 29 | echo "##vso[task.setvariable variable=dryRunArg]$dryRunArg" 30 | displayName: Set dry-run arg for non-prod 31 | -------------------------------------------------------------------------------- /eng/common/templates/steps/set-image-info-path-var.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | publicSourceBranch: null 3 | 4 | steps: 5 | - powershell: | 6 | $basePath = "$(gitHubVersionsRepoInfo.path)" 7 | 8 | $publicSourceBranch = "${{ parameters.publicSourceBranch }}" 9 | 10 | if ($publicSourceBranch -eq "") { 11 | throw "publicSourceBranch variable is not set" 12 | } 13 | 14 | $buildRepoName = "$(Build.Repository.Name)".Replace("/", "-") 15 | $imageInfoName = "image-info.$buildRepoName-$publicSourceBranch$(imageInfoVariant).json" 16 | 17 | echo "##vso[task.setvariable variable=imageInfoVersionsPath]$basePath/$imageInfoName" 18 | echo "##vso[task.setvariable variable=gitHubImageInfoVersionsPath]$(gitHubVersionsRepoInfo.path)/$imageInfoName" 19 | displayName: Set Image Info Path Vars 20 | -------------------------------------------------------------------------------- /eng/common/templates/steps/validate-branch.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | publishConfig: null 3 | internalProjectName: null 4 | 5 | steps: 6 | - ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}: 7 | - powershell: | 8 | if ("$env:ONEESPT_BUILDTYPE" -eq "Unofficial") 9 | { 10 | echo "Build is from an unofficial pipeline, continuing..." 11 | exit 0 12 | } 13 | 14 | if ("$(officialBranches)".Split(',').Contains("$(sourceBranch)") ` 15 | -and "$(officialRepoPrefixes)".Split(',').Contains("${{ parameters.publishConfig.publishAcr.repoPrefix }}")) 16 | { 17 | echo "Conditions met for official build, continuing..." 18 | exit 0 19 | } 20 | 21 | if (-not "$(officialRepoPrefixes)".Split(',').Contains("${{ parameters.publishConfig.publishAcr.repoPrefix }}")) 22 | { 23 | echo "This build is a test build, continuing..." 24 | exit 0 25 | } 26 | 27 | if ("${{ variables['overrideOfficialBranchValidation'] }}" -eq "true") 28 | { 29 | echo "Variable overrideOfficialBranchValidation is set to true, continuing..." 30 | exit 0 31 | } 32 | 33 | echo "##vso[task.logissue type=error]Official builds must be done from an official branch ($(officialBranches)) and repo prefix ($(officialRepoPrefixes))." 34 | echo "Build definition: $(Build.DefinitionName)" 35 | echo "1ESPT build type: $(OneESPT.BuildType)" 36 | echo "Current branch: $(sourceBranch)" 37 | echo "Publish repo prefix: ${{ parameters.publishConfig.publishAcr.repoPrefix }}" 38 | exit 1 39 | displayName: Validate Branch 40 | -------------------------------------------------------------------------------- /eng/common/templates/steps/validate-image-sizes.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | dockerClientOS: null 3 | architecture: "*" 4 | validationMode: "all" 5 | 6 | steps: 7 | - template: ${{ format('../steps/init-docker-{0}.yml', parameters.dockerClientOS) }} 8 | parameters: 9 | # Get some disk space back, pipeline run time is not a concern here 10 | cleanupDocker: true 11 | - powershell: > 12 | ./tests/performance/Validate-ImageSize.ps1 13 | -ImageBuilderCustomArgs "--architecture '${{ parameters.architecture }}'" 14 | -ValidationMode:${{ parameters.validationMode }} 15 | -PullImages 16 | displayName: Run Image Size Tests 17 | -------------------------------------------------------------------------------- /eng/common/templates/steps/wait-for-mcr-doc-ingestion.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | commitDigest: null 3 | condition: true 4 | dryRunArg: "" 5 | 6 | steps: 7 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 8 | parameters: 9 | displayName: Wait for MCR Doc Ingestion 10 | condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true')) 11 | serviceConnections: 12 | - name: mar 13 | id: $(marStatus.serviceConnection.id) 14 | tenantId: $(marStatus.serviceConnection.tenantId) 15 | clientId: $(marStatus.serviceConnection.clientId) 16 | internalProjectName: 'internal' 17 | args: >- 18 | waitForMcrDocIngestion 19 | '${{ parameters.commitDigest }}' 20 | --timeout '$(mcrDocIngestionTimeout)' 21 | ${{ parameters.dryRunArg }} 22 | -------------------------------------------------------------------------------- /eng/common/templates/steps/wait-for-mcr-image-ingestion.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: publishConfig 3 | type: object 4 | 5 | - name: imageInfoPath 6 | type: string 7 | 8 | - name: minQueueTime 9 | type: string 10 | 11 | - name: dryRunArg 12 | type: string 13 | 14 | - name: condition 15 | type: string 16 | default: "true" 17 | 18 | steps: 19 | - template: /eng/common/templates/steps/run-imagebuilder.yml@self 20 | parameters: 21 | displayName: Wait for Image Ingestion 22 | condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true')) 23 | serviceConnections: 24 | - name: mar 25 | id: $(marStatus.serviceConnection.id) 26 | tenantId: $(marStatus.serviceConnection.tenantId) 27 | clientId: $(marStatus.serviceConnection.clientId) 28 | internalProjectName: 'internal' 29 | args: >- 30 | waitForMcrImageIngestion 31 | '${{ parameters.imageInfoPath }}' 32 | --manifest '$(manifest)' 33 | --repo-prefix '${{ parameters.publishConfig.publishAcr.repoPrefix }}' 34 | --min-queue-time '${{ parameters.minQueueTime }}' 35 | --timeout '$(mcrImageIngestionTimeout)' 36 | $(manifestVariables) 37 | ${{ parameters.dryRunArg }} 38 | -------------------------------------------------------------------------------- /eng/common/templates/variables/common-paths.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | engCommonRelativePath: eng/common 3 | engCommonPath: $(Build.Repository.LocalPath)/$(engCommonRelativePath) 4 | engPath: $(Build.Repository.LocalPath)/eng 5 | testScriptPath: "" 6 | -------------------------------------------------------------------------------- /eng/common/templates/variables/docker-images.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2781076 3 | imageNames.imageBuilder: $(imageNames.imageBuilderName) 4 | imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId) 5 | imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux3.0-docker-testrunner 6 | imageNames.testRunner.withrepo: testrunner-withrepo:$(Build.BuildId)-$(System.JobId) 7 | imageNames.syft: anchore/syft:v1.31.0-debug 8 | -------------------------------------------------------------------------------- /eng/common/templates/variables/dotnet/build-test-publish.yml: -------------------------------------------------------------------------------- 1 | # Common variables for building/testing/publishing in the .NET team's pipelines 2 | 3 | variables: 4 | - template: /eng/common/templates/variables/dotnet/common.yml@self 5 | 6 | - name: commonVersionsImageInfoPath 7 | value: build-info/docker 8 | - name: publicGitRepoUri 9 | value: https://github.com/dotnet/dotnet-docker 10 | - name: testScriptPath 11 | value: ./tests/run-tests.ps1 12 | - name: testResultsDirectory 13 | value: tests/Microsoft.DotNet.Docker.Tests/TestResults/ 14 | 15 | - name: officialRepoPrefixes 16 | value: public/,internal/private/,unlisted/ 17 | readonly: true 18 | 19 | - name: mcrDocsRepoInfo.userName 20 | value: $(gitHubApp.marDocsUpdater.userName) 21 | - name: mcrDocsRepoInfo.email 22 | value: $(gitHubApp.marDocsUpdater.email) 23 | 24 | - name: publishNotificationsEnabled 25 | value: true 26 | - name: gitHubNotificationsRepoInfo.org 27 | value: dotnet 28 | - name: gitHubNotificationsRepoInfo.repo 29 | value: dotnet-docker-internal 30 | # $(gitHubNotificationsRepoInfo.authArgs) is needed by the "Post Publish 31 | # Notification" step in eng/common/templates/jobs/publish.yml#L271, even during 32 | # a dry-run. This value is a placeholder that gets replaced when referencing 33 | # the secrets.yml variable template. 34 | - name: gitHubNotificationsRepoInfo.authArgs 35 | value: --gh-token 'placeholder' 36 | 37 | - name: gitHubVersionsRepoInfo.org 38 | value: dotnet 39 | - name: gitHubVersionsRepoInfo.repo 40 | value: versions 41 | - name: gitHubVersionsRepoInfo.branch 42 | value: main 43 | - name: gitHubVersionsRepoInfo.path 44 | value: ${{ variables.commonVersionsImageInfoPath }} 45 | - name: gitHubVersionsRepoInfo.userName 46 | value: $(dotnetDockerBot.userName) 47 | - name: gitHubVersionsRepoInfo.email 48 | value: $(dotnetDockerBot.email) 49 | -------------------------------------------------------------------------------- /eng/common/templates/variables/dotnet/common.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - template: /eng/common/templates/variables/common.yml@self 3 | 4 | - name: publicProjectName 5 | value: public 6 | - name: internalProjectName 7 | value: internal 8 | 9 | # $(dockerHubRegistryCreds) is needed by the copy-base-images step in 10 | # eng/common/templates/stages/build-and-test.yml#L73-L78, even during a dry-run. 11 | # This is a placeholder that gets replaced when referencing the secrets.yml 12 | # variable template. 13 | - name: dockerHubRegistryCreds 14 | value: --registry-creds 'docker.io=placeholder;placeholder' 15 | 16 | - name: linuxAmd64InternalPoolImage 17 | value: 1es-ubuntu-2204 18 | - name: linuxAmd64InternalPoolName 19 | value: NetCore1ESPool-Internal 20 | 21 | - name: linuxArm64PoolImage 22 | value: Mariner-2-Docker-ARM64 23 | - name: linuxArm64PublicPoolName 24 | value: Docker-Linux-Arm-Public 25 | - name: linuxArm64InternalPoolName 26 | value: Docker-Linux-Arm-Internal 27 | 28 | - name: linuxArm32PoolImage 29 | value: Mariner-2-Docker-ARM64 30 | - name: linuxArm32PublicPoolName 31 | value: Docker-Linux-Arm-Public 32 | - name: linuxArm32InternalPoolName 33 | value: Docker-Linux-Arm-Internal 34 | 35 | - name: windowsServer2016PublicPoolImage 36 | value: Server2016-NESDockerBuilds 37 | - name: windowsServer2016InternalPoolImage 38 | value: Server2016-NESDockerBuilds-1ESPT 39 | - name: windowsServer2016PoolName 40 | value: Docker-2016-${{ variables['System.TeamProject'] }} 41 | 42 | - name: windowsServer2019PublicPoolImage 43 | value: Server2019-1809-NESDockerBuilds 44 | - name: windowsServer2019InternalPoolImage 45 | value: Server2019-1809-NESDockerBuilds-1ESPT 46 | - name: windowsServer2019PoolName 47 | value: Docker-1809-${{ variables['System.TeamProject'] }} 48 | 49 | - name: windowsServer2022PublicPoolImage 50 | value: Server2022-NESDockerBuilds 51 | - name: windowsServer2022InternalPoolImage 52 | value: Server2022-NESDockerBuilds-1ESPT 53 | - name: windowsServer2022PoolName 54 | value: Docker-2022-${{ variables['System.TeamProject'] }} 55 | 56 | - name: windowsServer2025PublicPoolImage 57 | value: Server2025-NESDockerBuilds 58 | - name: windowsServer2025InternalPoolImage 59 | value: Server2025-NESDockerBuilds-1ESPT 60 | - name: windowsServer2025PoolName 61 | value: Docker-2025-${{ variables['System.TeamProject'] }} 62 | 63 | - group: DotNet-Docker-Common-2 64 | -------------------------------------------------------------------------------- /eng/common/templates/variables/dotnet/secrets-unofficial.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - group: DotNet-Docker-Secrets-Unofficial 3 | 4 | - name: dockerHubRegistryCreds 5 | value: --registry-creds 'docker.io=$(dotnetDockerHubBot.userName);$(BotAccount-dotnet-dockerhub-bot-PAT)' 6 | -------------------------------------------------------------------------------- /eng/common/templates/variables/dotnet/secrets.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - group: DotNet-Docker-Secrets 3 | 4 | - name: dockerHubRegistryCreds 5 | value: --registry-creds 'docker.io=$(dotnetDockerHubBot.userName);$(BotAccount-dotnet-dockerhub-bot-PAT)' 6 | 7 | - name: gitHubNotificationsRepoInfo.authArgs 8 | value: --gh-token '$(BotAccount-dotnet-docker-bot-PAT)' 9 | 10 | - name: gitHubVersionsRepoInfo.authArgs 11 | value: --gh-token '$(BotAccount-dotnet-docker-bot-PAT)' 12 | 13 | - name: mcrDocsRepoInfo.authArgs 14 | value: >- 15 | --gh-private-key '$(GitHubApp-NET-Docker-MAR-Docs-Updater-PrivateKey)' 16 | --gh-app-client-id '$(gitHubApp.marDocsUpdater.clientId)' 17 | --gh-app-installation-id '$(gitHubApp.marDocsUpdater.microsoft.installationId)' 18 | -------------------------------------------------------------------------------- /eng/pipelines/dotnet-buildtools-prereqs-eng.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: 3 | branches: 4 | include: 5 | - main 6 | paths: 7 | exclude: 8 | - src/* 9 | - "*.md" 10 | - .git* 11 | - CODEOWNERS 12 | - LICENSE 13 | 14 | variables: 15 | - template: /eng/pipelines/variables/common.yml@self 16 | - name: imageBuilder.pathArgs 17 | value: --path '*' 18 | # Since this pipeline is intended to test the infra, we don't want to trim the cached images from the matrix. 19 | # This enables the entire pipeline to be exercised. 20 | - name: trimCachedImagesForMatrix 21 | value: false 22 | 23 | resources: 24 | repositories: 25 | - repository: VersionsRepo 26 | type: github 27 | endpoint: public 28 | name: dotnet/versions 29 | ref: ${{ variables['gitHubVersionsRepoInfo.branch'] }} 30 | 31 | stages: 32 | - template: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self 33 | parameters: 34 | stagesTemplate: /eng/pipelines/stages/build-test-publish-repo.yml@self 35 | stagesTemplateParameters: 36 | versionsRepoRef: VersionsRepo 37 | linuxAmdBuildJobTimeout: 360 38 | linuxArmBuildJobTimeout: 300 39 | customBuildInitSteps: 40 | - template: /eng/pipelines/steps/install-cross-build-prereqs.yml 41 | -------------------------------------------------------------------------------- /eng/pipelines/dotnet-buildtools-prereqs-official.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | branches: 3 | include: 4 | - main 5 | paths: 6 | include: 7 | - src/* 8 | pr: none 9 | 10 | parameters: 11 | - name: disableMatrixTrimming 12 | displayName: Disable matrix trimming 13 | type: boolean 14 | default: false 15 | 16 | - name: sourceBuildPipelineRunId 17 | displayName: > 18 | Source build pipeline run ID. This refers to runs of *this pipeline*. 19 | Override this parameter in combination with disabling the `Build` stage to 20 | test or publish images that were built in a different pipeline run. When 21 | building new images, leave this value alone. 22 | type: string 23 | default: $(Build.BuildId) 24 | 25 | schedules: 26 | - cron: "0 5 1,15 * *" 27 | displayName: Monthly rebuild of all images 28 | branches: 29 | include: 30 | - main 31 | always: true 32 | 33 | variables: 34 | - template: /eng/pipelines/variables/common.yml@self 35 | parameters: 36 | disableMatrixTrimming: ${{ parameters.disableMatrixTrimming }} 37 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 38 | - template: /eng/common/templates/variables/dotnet/secrets.yml@self 39 | - name: publishEolAnnotations 40 | value: true 41 | - name: Codeql.ExcludePathPatterns 42 | value: tests 43 | readonly: true 44 | 45 | resources: 46 | repositories: 47 | - repository: VersionsRepo 48 | type: github 49 | endpoint: dotnet 50 | name: dotnet/versions 51 | ref: ${{ variables['gitHubVersionsRepoInfo.branch'] }} 52 | 53 | extends: 54 | template: /eng/common/templates/1es.yml@self 55 | parameters: 56 | reposToExcludeFromScanning: 57 | - VersionsRepo 58 | stages: 59 | - template: /eng/pipelines/stages/dotnet-buildtools-prereqs.yml@self 60 | parameters: 61 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 62 | publishConfigTemplatePath: /eng/common/templates/stages/dotnet/publish-config-prod.yml@self 63 | -------------------------------------------------------------------------------- /eng/pipelines/dotnet-buildtools-prereqs-pr.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: 3 | branches: 4 | include: 5 | - main 6 | paths: 7 | include: 8 | - src/* 9 | 10 | variables: 11 | - template: variables/common.yml 12 | 13 | resources: 14 | repositories: 15 | - repository: VersionsRepo 16 | type: github 17 | endpoint: public 18 | name: dotnet/versions 19 | ref: ${{ variables['gitHubVersionsRepoInfo.branch'] }} 20 | 21 | stages: 22 | - template: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self 23 | parameters: 24 | stagesTemplate: /eng/pipelines/stages/build-test-publish-repo.yml@self 25 | stagesTemplateParameters: 26 | versionsRepoRef: VersionsRepo 27 | linuxAmdBuildJobTimeout: 480 28 | linuxArmBuildJobTimeout: 300 29 | linuxAmd64Pool: 30 | name: NetCore-Public-XL 31 | demands: ImageOverride -equals build.Ubuntu.2204.amd64.open 32 | customBuildInitSteps: 33 | - template: /eng/pipelines/steps/install-cross-build-prereqs.yml 34 | -------------------------------------------------------------------------------- /eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | parameters: 5 | - name: disableMatrixTrimming 6 | displayName: Disable matrix trimming 7 | type: boolean 8 | default: false 9 | 10 | - name: sourceBuildPipelineRunId 11 | displayName: > 12 | Source build pipeline run ID. This refers to runs of *this pipeline*. 13 | Override this parameter in combination with disabling the `Build` stage to 14 | test or publish images that were built in a different pipeline run. When 15 | building new images, leave this value alone. 16 | type: string 17 | default: $(Build.BuildId) 18 | 19 | variables: 20 | - template: /eng/pipelines/variables/common.yml@self 21 | parameters: 22 | disableMatrixTrimming: ${{ parameters.disableMatrixTrimming }} 23 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 24 | - template: /eng/common/templates/variables/dotnet/secrets-unofficial.yml@self 25 | - name: publishEolAnnotations 26 | value: true 27 | 28 | resources: 29 | repositories: 30 | - repository: VersionsRepo 31 | type: github 32 | endpoint: dotnet 33 | name: dotnet/versions 34 | ref: ${{ variables['gitHubVersionsRepoInfo.branch'] }} 35 | 36 | extends: 37 | template: /eng/common/templates/1es.yml@self 38 | parameters: 39 | reposToExcludeFromScanning: 40 | - VersionsRepo 41 | stages: 42 | - template: /eng/pipelines/stages/dotnet-buildtools-prereqs.yml@self 43 | parameters: 44 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 45 | publishConfigTemplatePath: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self 46 | -------------------------------------------------------------------------------- /eng/pipelines/stages/build-test-publish-repo.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | publishConfig: null 3 | noCache: false 4 | internalProjectName: null 5 | publicProjectName: null 6 | linuxAmdBuildJobTimeout: 60 7 | linuxArmBuildJobTimeout: 60 8 | customBuildInitSteps: [] 9 | customCopyBaseImagesInitSteps: [] 10 | linuxAmd64Pool: '' 11 | versionsRepoRef: null 12 | additionalServiceConnections: [] 13 | 14 | stages: 15 | - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: 16 | - template: /eng/common/templates/stages/setup-service-connections.yml@self 17 | parameters: 18 | serviceConnections: 19 | - name: ${{ parameters.publishConfig.internalMirrorAcr.serviceConnection.name }} 20 | - name: ${{ parameters.publishConfig.buildAcr.serviceConnection.name }} 21 | - name: ${{ parameters.publishConfig.publishAcr.serviceConnection.name }} 22 | - ${{ each serviceConnection in parameters.additionalServiceConnections }}: 23 | - name: ${{ serviceConnection.name }} 24 | 25 | - template: /eng/common/templates/stages/dotnet/build-test-publish-repo.yml@self 26 | parameters: 27 | publishConfig: ${{ parameters.publishConfig }} 28 | noCache: ${{ parameters.noCache }} 29 | internalProjectName: ${{ parameters.internalProjectName }} 30 | publicProjectName: ${{ parameters.publicProjectName }} 31 | versionsRepoRef: ${{ parameters.versionsRepoRef }} 32 | 33 | ${{ if and(eq(variables['System.TeamProject'], parameters.publicProjectName), eq(parameters.linuxAmd64Pool, ''))}}: 34 | linuxAmd64Pool: 35 | name: NetCore-Public 36 | demands: ImageOverride -equals build.ubuntu.2204.amd64.open 37 | ${{ else }}: 38 | linuxAmd64Pool: ${{ parameters.linuxAmd64Pool }} 39 | 40 | linuxAmdBuildJobTimeout: ${{ parameters.linuxAmdBuildJobTimeout }} 41 | linuxArmBuildJobTimeout: ${{ parameters.linuxArmBuildJobTimeout }} 42 | 43 | customBuildInitSteps: ${{ parameters.customBuildInitSteps }} 44 | customCopyBaseImagesInitSteps: ${{ parameters.customCopyBaseImagesInitSteps }} 45 | -------------------------------------------------------------------------------- /eng/pipelines/stages/dotnet-buildtools-prereqs.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: sourceBuildPipelineRunId 3 | type: string 4 | default: $(Build.BuildId) 5 | 6 | - name: publishConfigTemplatePath 7 | type: string 8 | 9 | stages: 10 | - template: ${{ parameters.publishConfigTemplatePath }} 11 | parameters: 12 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 13 | stagesTemplate: /eng/pipelines/stages/build-test-publish-repo.yml@self 14 | stagesTemplateParameters: 15 | versionsRepoRef: VersionsRepo 16 | linuxAmdBuildJobTimeout: 480 17 | linuxArmBuildJobTimeout: 300 18 | linuxAmd64Pool: 19 | name: NetCore1ESPool-Internal-XL 20 | image: 1es-ubuntu-2204 21 | os: linux 22 | ${{ if eq(variables['System.TeamProject'], 'internal') }}: 23 | customCopyBaseImagesInitSteps: 24 | - template: /eng/pipelines/steps/set-base-image-override-options.yml@self 25 | parameters: 26 | variableName: customCopyBaseImagesArgs 27 | dockerfileOs: (centos|debian) 28 | baseOverrideRegistry: $(overrideRegistry) # Comes from DotNet-Docker-Common variable group 29 | customBuildInitSteps: 30 | - template: /eng/pipelines/steps/install-cross-build-prereqs.yml@self 31 | - ${{ if eq(variables['System.TeamProject'], 'internal') }}: 32 | - template: /eng/pipelines/steps/set-base-image-override-options.yml@self 33 | parameters: 34 | variableName: imageBuilderBuildArgs 35 | dockerfileOs: (centos|debian) 36 | baseOverrideRegistry: $(overrideRegistry) # Comes from DotNet-Docker-Common variable group 37 | # Force all images to be rebuilt when triggered by the schedule 38 | # See https://github.com/dotnet/dotnet-buildtools-prereqs-docker/issues/1224 39 | ${{ if eq(variables['Build.Reason'], 'Schedule') }}: 40 | noCache: true 41 | ${{ if contains(variables['Build.DefinitionName'], '-official') }}: 42 | additionalServiceConnections: 43 | - name: $(marStatus.serviceConnectionName) 44 | -------------------------------------------------------------------------------- /eng/pipelines/steps/install-cross-build-prereqs.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - script: ./$(buildRepoName)/src/ubuntu/build-scripts/install-cross-build-prereqs.sh 3 | displayName: Install Cross Build Pre-Reqs 4 | condition: and(succeeded(), contains(variables.imageBuilderPaths, '/cross'), not(contains(variables.imageBuilderPaths, '/raspbian'))) 5 | -------------------------------------------------------------------------------- /eng/pipelines/steps/set-base-image-override-options.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # Name of the pipeline variable to append the options to 3 | variableName: null 4 | dockerfileOs: '' 5 | baseOverrideRegistry: '' 6 | 7 | steps: 8 | # Configures Image Builder options to override the base image tags for Ubuntu as defined in the Dockerfiles 9 | # and instead use the corresponding image from the Ubuntu ACR. 10 | - powershell: | 11 | # For official builds, we configure the regex and substitution 12 | # to use a different registry. (e.g. "ubuntu:20.04" becomes "parameters.baseOverrideRegistry/ubuntu:20.04")". 13 | $baseOverrideRegex = "^(${{ parameters.dockerfileOs }}:.+)" 14 | 15 | # Be sure to use the string literal syntax here (single quote) to avoid $1 being interpreted as a variable 16 | $baseOverrideSubstitution = '${{ parameters.baseOverrideRegistry }}/$1' 17 | 18 | # Assume the variable already exists and append to it. This allows us to dynamically append additional 19 | # options to a general purpose variable. 20 | $options = "$(${{ parameters.variableName }})" 21 | $options += " --base-override-regex '$baseOverrideRegex' --base-override-sub '$baseOverrideSubstitution'" 22 | echo "##vso[task.setvariable variable=${{ parameters.variableName }}]$options" 23 | displayName: Set Base Image Override Options -------------------------------------------------------------------------------- /eng/pipelines/variables/common.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: disableMatrixTrimming 3 | type: boolean 4 | default: false 5 | # sourceBuildPipelineRunId should be overridden when skipping a build to run 6 | # tests or publish images that were produced in a different pipeline run. 7 | - name: sourceBuildPipelineRunId 8 | type: string 9 | default: "" 10 | 11 | variables: 12 | - template: /eng/common/templates/variables/dotnet/build-test-publish.yml@self 13 | parameters: 14 | sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} 15 | - name: officialBranches 16 | # comma-delimited list of branch names 17 | value: main 18 | - name: manifest 19 | value: manifest.json 20 | - name: dotnetVersion 21 | value: '*' 22 | - name: osVariant 23 | value: '' 24 | - name: publishReadme 25 | value: false 26 | - name: imageBuilderBuildArgs 27 | value: '' 28 | - name: publicGitRepoUri 29 | value: https://github.com/dotnet/dotnet-buildtools-prereqs-docker 30 | - name: publicSourceBranch 31 | value: main 32 | - name: ingestKustoImageInfo 33 | value: false 34 | - name: testScriptPath 35 | value: "" 36 | - ${{ if not(parameters.disableMatrixTrimming) }}: 37 | - name: trimCachedImagesForMatrix 38 | value: true 39 | - name: gitHubNotificationsRepoInfo.repo 40 | value: dotnet-buildtools-prereqs-docker-internal 41 | -------------------------------------------------------------------------------- /es-metadata.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 0.0.1 2 | isProduction: true 3 | accountableOwners: 4 | service: 33d7954d-0688-4e7b-9208-087c9e57f21a 5 | routing: 6 | defaultAreaPath: 7 | org: dnceng 8 | path: internal\.NET Acquisition and Deployment 9 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "registry": "mcr.microsoft.com", 3 | "includes": [ 4 | "src/almalinux/manifest.json", 5 | "src/alpine/manifest.json", 6 | "src/azurelinux/manifest.json", 7 | "src/cbl-mariner/manifest.json", 8 | "src/centos-stream/manifest.json", 9 | "src/debian/manifest.json", 10 | "src/fedora/manifest.json", 11 | "src/nanoserver/manifest.json", 12 | "src/opensuse/manifest.json", 13 | "src/ubuntu/manifest.json", 14 | "src/windowsservercore/manifest.json" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /run-tests.ps1: -------------------------------------------------------------------------------- 1 | [cmdletbinding()] 2 | param( 3 | # Additional args to pass to dotnet run 4 | [string]$OptionalArgs 5 | ) 6 | 7 | Set-StrictMode -Version Latest 8 | $ErrorActionPreference = 'Stop' 9 | 10 | function Log { 11 | param ([string] $Message) 12 | 13 | Write-Output $Message 14 | } 15 | 16 | function Exec { 17 | param ([string] $Cmd) 18 | 19 | Log "Executing: '$Cmd'" 20 | Invoke-Expression $Cmd 21 | if ($LASTEXITCODE -ne 0) { 22 | throw "Failed: '$Cmd'" 23 | } 24 | } 25 | 26 | $EngCommonDir = "$PSScriptRoot/eng/common" 27 | 28 | $DotnetInstallDir = "$PSScriptRoot/.dotnet" 29 | & $EngCommonDir/Install-DotNetSdk.ps1 -InstallPath $DotnetInstallDir 30 | 31 | Push-Location "$PSScriptRoot\tests\Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests" 32 | try { 33 | Exec "$DotnetInstallDir/dotnet run --project Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests.csproj --report-xunit-trx --results-directory $PSScriptRoot/artifacts/TestResults $OptionalArgs" 34 | } 35 | finally { 36 | Pop-Location 37 | } 38 | -------------------------------------------------------------------------------- /src/almalinux/10/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:10 AS venv 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf install --setopt tsflags=nodocs -y \ 5 | gcc \ 6 | gcc-c++ \ 7 | python3.12 \ 8 | python3.12-devel \ 9 | python3.12-pip 10 | 11 | RUN python3 -m venv /venv \ 12 | && . /venv/bin/activate \ 13 | && pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ 14 | && pip install ./helix_scripts-*-py3-none-any.whl \ 15 | && rm ./helix_scripts-*-py3-none-any.whl 16 | 17 | 18 | FROM library/almalinux:10 19 | 20 | # Install dependencies 21 | RUN dnf upgrade --refresh -y \ 22 | && dnf install --setopt tsflags=nodocs -y \ 23 | dnf-plugins-core \ 24 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 25 | && dnf install --setopt tsflags=nodocs -y --allowerasing \ 26 | cpio \ 27 | file \ 28 | libicu \ 29 | libmsquic \ 30 | python3.12 \ 31 | sudo \ 32 | && dnf clean all 33 | 34 | # create helixbot user and give rights to sudo without password 35 | RUN adduser --uid 1000 --shell /bin/bash --gid adm helixbot \ 36 | && chmod 755 /root \ 37 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 38 | 39 | USER helixbot 40 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 41 | 42 | # Install Helix Dependencies 43 | RUN python3 -m venv $VIRTUAL_ENV 44 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 45 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 46 | -------------------------------------------------------------------------------- /src/almalinux/10/source-build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:10 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | && dnf install --setopt tsflags=nodocs -y \ 6 | 'dnf-command(config-manager)' \ 7 | epel-release \ 8 | && dnf config-manager --set-enabled crb \ 9 | && dnf config-manager --set-enabled epel \ 10 | && dnf install --setopt tsflags=nodocs -y \ 11 | "perl(Time::HiRes)" \ 12 | autoconf \ 13 | automake \ 14 | brotli-devel \ 15 | cmake \ 16 | cpio \ 17 | elfutils \ 18 | file \ 19 | gdb \ 20 | git \ 21 | glibc-langpack-en \ 22 | iproute \ 23 | jq \ 24 | krb5-devel \ 25 | libcurl-devel \ 26 | libicu-devel \ 27 | libtool \ 28 | # Requires epel 29 | libunwind-devel \ 30 | libuuid-devel \ 31 | libxml2-devel \ 32 | llvm-toolset \ 33 | lld \ 34 | # Requires powertools 35 | lttng-ust-devel \ 36 | make \ 37 | ncurses-devel \ 38 | nodejs \ 39 | numactl-devel \ 40 | openssl-devel \ 41 | readline-devel \ 42 | python3.12 \ 43 | sudo \ 44 | swig \ 45 | wget \ 46 | which \ 47 | xz \ 48 | zlib-devel \ 49 | && dnf clean all 50 | -------------------------------------------------------------------------------- /src/almalinux/8/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:8 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf install --setopt tsflags=nodocs -y \ 5 | 'dnf-command(config-manager)' \ 6 | # Add microsoft centos/8 repo for libmsquic. 7 | # (Use centos/8 rather than rhel/8 because the latter doesn't have 8 | # libmsquic except in the 8.1-specific packages feed.) 9 | && dnf config-manager --add-repo=https://packages.microsoft.com/centos/8/prod/config.repo \ 10 | && dnf install --setopt tsflags=nodocs -y \ 11 | # Get recent python3 This is needed to get a pip recent enough 12 | # not to fail the build when installing cryptography library as 13 | # a dependency of the helix scripts. 14 | python39 \ 15 | # Required for asp.net core test runs 16 | sudo \ 17 | libicu \ 18 | libmsquic \ 19 | # Required for arcade test runs 20 | cpio \ 21 | file \ 22 | && dnf clean all 23 | 24 | # Test runs expect python to be available without version suffix 25 | RUN alternatives --set python /usr/bin/python3 \ 26 | && ln -sf /usr/bin/pip3 /usr/bin/pip 27 | 28 | ENV LANG=en-US.UTF-8 29 | 30 | # create helixbot user and give rights to sudo without password 31 | RUN adduser --uid 1000 --shell /bin/bash --gid adm helixbot \ 32 | && chmod 755 /root \ 33 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 34 | 35 | USER helixbot 36 | WORKDIR /home/helixbot 37 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 38 | 39 | RUN python -m venv $VIRTUAL_ENV && \ 40 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 41 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 42 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 43 | rm ./helix_scripts-*-py3-none-any.whl 44 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 45 | -------------------------------------------------------------------------------- /src/almalinux/8/source-build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:8 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | && dnf install --setopt tsflags=nodocs -y \ 6 | 'dnf-command(config-manager)' \ 7 | epel-release \ 8 | && dnf config-manager --set-enabled powertools \ 9 | && dnf config-manager --set-enabled epel \ 10 | && dnf install --setopt tsflags=nodocs -y \ 11 | "perl(Time::HiRes)" \ 12 | autoconf \ 13 | automake \ 14 | brotli-devel \ 15 | cmake \ 16 | cpio \ 17 | elfutils \ 18 | file \ 19 | gdb \ 20 | git \ 21 | glibc-langpack-en \ 22 | iproute \ 23 | jq \ 24 | krb5-devel \ 25 | libcurl-devel \ 26 | libicu-devel \ 27 | libtool \ 28 | # Requires epel 29 | libunwind-devel \ 30 | libuuid-devel \ 31 | libxml2-devel \ 32 | llvm-toolset \ 33 | lld \ 34 | # Requires powertools 35 | lttng-ust-devel \ 36 | make \ 37 | ncurses-devel \ 38 | numactl-devel \ 39 | openssl-devel \ 40 | readline-devel \ 41 | python3 \ 42 | sudo \ 43 | swig \ 44 | wget \ 45 | which \ 46 | xz \ 47 | zlib-devel \ 48 | && dnf module install -y \ 49 | nodejs:20 \ 50 | && dnf clean all 51 | -------------------------------------------------------------------------------- /src/almalinux/9/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:9 AS venv 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf install --setopt tsflags=nodocs -y \ 5 | gcc \ 6 | gcc-c++ \ 7 | python3.12 \ 8 | python3.12-devel \ 9 | python3.12-pip 10 | 11 | RUN python3 -m venv /venv \ 12 | && . /venv/bin/activate \ 13 | && pip install --upgrade pip setuptools \ 14 | && pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ 15 | && pip install ./helix_scripts-*-py3-none-any.whl \ 16 | && rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | 19 | FROM library/almalinux:9 20 | 21 | # Install dependencies 22 | RUN dnf upgrade --refresh -y \ 23 | && dnf install --setopt tsflags=nodocs -y \ 24 | dnf-plugins-core \ 25 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 26 | && dnf install --setopt tsflags=nodocs -y --allowerasing \ 27 | cpio \ 28 | file \ 29 | libicu \ 30 | libmsquic \ 31 | python3.12 \ 32 | sudo \ 33 | && dnf clean all 34 | 35 | ENV LANG=en_US.utf8 36 | 37 | # create helixbot user and give rights to sudo without password 38 | RUN adduser --uid 1000 --shell /bin/bash --gid adm helixbot \ 39 | && chmod 755 /root \ 40 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 41 | 42 | USER helixbot 43 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 44 | 45 | # Install Helix Dependencies 46 | RUN python3 -m venv $VIRTUAL_ENV \ 47 | && ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools 48 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 49 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 50 | -------------------------------------------------------------------------------- /src/almalinux/9/source-build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/almalinux:9 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | && dnf install --setopt tsflags=nodocs -y \ 6 | 'dnf-command(config-manager)' \ 7 | epel-release \ 8 | && dnf config-manager --set-enabled crb \ 9 | && dnf config-manager --set-enabled epel \ 10 | && dnf install --setopt tsflags=nodocs -y \ 11 | "perl(Time::HiRes)" \ 12 | autoconf \ 13 | automake \ 14 | brotli-devel \ 15 | cmake \ 16 | cpio \ 17 | elfutils \ 18 | file \ 19 | gdb \ 20 | git \ 21 | glibc-langpack-en \ 22 | iproute \ 23 | jq \ 24 | krb5-devel \ 25 | libcurl-devel \ 26 | libicu-devel \ 27 | libtool \ 28 | # Requires epel 29 | libunwind-devel \ 30 | libuuid-devel \ 31 | libxml2-devel \ 32 | llvm-toolset \ 33 | lld \ 34 | # Requires powertools 35 | lttng-ust-devel \ 36 | make \ 37 | ncurses-devel \ 38 | numactl-devel \ 39 | openssl-devel \ 40 | readline-devel \ 41 | python3.12 \ 42 | sudo \ 43 | swig \ 44 | wget \ 45 | which \ 46 | xz \ 47 | zlib-devel \ 48 | && dnf module install -y \ 49 | nodejs:22 \ 50 | && dnf clean all 51 | -------------------------------------------------------------------------------- /src/almalinux/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "repos": [ 3 | { 4 | "name": "dotnet-buildtools/prereqs", 5 | "images": [ 6 | { 7 | "platforms": [ 8 | { 9 | "dockerfile": "src/almalinux/8/source-build/amd64", 10 | "os": "linux", 11 | "osVersion": "almalinux8", 12 | "tags": { 13 | "almalinux-8-source-build": {}, 14 | "almalinux-8-source-build-amd64": {} 15 | } 16 | }, 17 | { 18 | "dockerfile": "src/almalinux/8/helix/amd64", 19 | "os": "linux", 20 | "osVersion": "almalinux8", 21 | "tags": { 22 | "almalinux-8-helix-amd64": {} 23 | } 24 | } 25 | ] 26 | }, 27 | { 28 | "platforms": [ 29 | { 30 | "dockerfile": "src/almalinux/9/source-build/amd64", 31 | "os": "linux", 32 | "osVersion": "almalinux9", 33 | "tags": { 34 | "almalinux-9-source-build-amd64": {} 35 | } 36 | }, 37 | { 38 | "dockerfile": "src/almalinux/9/helix/amd64", 39 | "os": "linux", 40 | "osVersion": "almalinux9", 41 | "tags": { 42 | "almalinux-9-helix-amd64": {} 43 | } 44 | } 45 | ] 46 | }, 47 | { 48 | "platforms": [ 49 | { 50 | "dockerfile": "src/almalinux/10/source-build/amd64", 51 | "os": "linux", 52 | "osVersion": "almalinux10", 53 | "tags": { 54 | "almalinux-10-source-build-amd64": {} 55 | } 56 | }, 57 | { 58 | "dockerfile": "src/almalinux/10/helix/amd64", 59 | "os": "linux", 60 | "osVersion": "almalinux10", 61 | "tags": { 62 | "almalinux-10-helix-amd64": {} 63 | } 64 | } 65 | ] 66 | } 67 | ] 68 | } 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /src/alpine/3.19/WithNode/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19 2 | 3 | RUN apk add --upgrade --no-cache \ 4 | nodejs \ 5 | npm 6 | 7 | # Add label for bring your own node in azure devops 8 | LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" 9 | 10 | ENV NO_UPDATE_NOTIFIER=true 11 | 12 | # Set node as a default command 13 | CMD [ "node" ] 14 | -------------------------------------------------------------------------------- /src/alpine/3.19/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amd64/alpine:3.19 2 | 3 | # Install .NET and test dependencies 4 | RUN apk add --upgrade --no-cache \ 5 | autoconf \ 6 | automake \ 7 | bash \ 8 | build-base \ 9 | brotli-dev \ 10 | ca-certificates \ 11 | clang \ 12 | clang-dev \ 13 | cmake \ 14 | coreutils \ 15 | cpio \ 16 | curl \ 17 | elfutils \ 18 | file \ 19 | gcc \ 20 | gettext-dev \ 21 | git \ 22 | icu-data-full \ 23 | icu-dev \ 24 | icu-libs \ 25 | iproute2 \ 26 | jq \ 27 | krb5-dev \ 28 | krb5-libs \ 29 | libtool \ 30 | less \ 31 | libgcc \ 32 | libintl \ 33 | libssl3 \ 34 | libstdc++ \ 35 | libunwind-dev \ 36 | linux-headers \ 37 | lld \ 38 | lldb-dev \ 39 | llvm \ 40 | lttng-ust-dev \ 41 | make \ 42 | ncurses-terminfo-base \ 43 | numactl-dev \ 44 | openssl \ 45 | openssl-dev \ 46 | paxctl \ 47 | pigz \ 48 | py3-lldb \ 49 | py3-pip \ 50 | python3-dev \ 51 | shadow \ 52 | sudo \ 53 | tzdata \ 54 | userspace-rcu \ 55 | util-linux-dev \ 56 | which \ 57 | zlib-dev 58 | 59 | # Install the latest non-preview powershell release. 60 | RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust \ 61 | && LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \ 62 | && curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-musl-x64.tar.gz -o /tmp/powershell.tar.gz \ 63 | && mkdir -p /opt/microsoft/powershell \ 64 | && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \ 65 | && chmod +x /opt/microsoft/powershell/pwsh \ 66 | && ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \ 67 | && rm -f /tmp/powershell.tar.gz 68 | 69 | # Install azurecli from PIP 70 | RUN azureEnv="/usr/local/share/azure-cli-env" && \ 71 | python3 -m venv "$azureEnv" && \ 72 | "$azureEnv/bin/python" -m pip install --upgrade setuptools && \ 73 | "$azureEnv/bin/python" -m pip install azure-cli && \ 74 | ln -s "$azureEnv/bin/az" /usr/local/bin/az 75 | -------------------------------------------------------------------------------- /src/alpine/3.20/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/alpine:3.20 AS venv 2 | 3 | RUN apk add --upgrade --no-cache \ 4 | cargo \ 5 | python3-dev \ 6 | build-base \ 7 | libffi-dev \ 8 | openssl-dev \ 9 | gcc \ 10 | linux-headers 11 | 12 | RUN python3 -m venv /venv && \ 13 | source /venv/bin/activate && \ 14 | pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 15 | pip install ./helix_scripts-*-py3-none-any.whl && \ 16 | rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | FROM library/alpine:3.20 19 | 20 | # Install .NET and test dependencies 21 | RUN apk add --upgrade --no-cache \ 22 | bash \ 23 | coreutils \ 24 | curl \ 25 | icu-data-full \ 26 | icu-libs \ 27 | iputils \ 28 | krb5-libs \ 29 | lldb \ 30 | llvm \ 31 | lttng-ust \ 32 | musl-locales \ 33 | numactl \ 34 | openssl \ 35 | python3 \ 36 | python3-dev \ 37 | py3-pip \ 38 | sudo \ 39 | tzdata 40 | 41 | # Install libmsquic from testing repository 42 | RUN apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ libmsquic 43 | 44 | # Needed for runtime tests to pass 45 | ENV LANG=en-US.UTF-8 46 | RUN echo export LANG=${LANG} >> /etc/profile.d/locale.sh 47 | 48 | # create helixbot user and give rights to sudo without password 49 | # Alpine does not support long options 50 | RUN /usr/sbin/adduser -D -g '' -G adm -s /bin/bash -u 1000 helixbot && \ 51 | chmod 755 /root && \ 52 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 53 | 54 | USER helixbot 55 | 56 | # Install Helix Dependencies 57 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 58 | RUN python3 -m venv $VIRTUAL_ENV 59 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 60 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 61 | -------------------------------------------------------------------------------- /src/alpine/3.21/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/alpine:3.21 AS venv 2 | 3 | RUN apk add --upgrade --no-cache \ 4 | cargo \ 5 | python3-dev \ 6 | build-base \ 7 | libffi-dev \ 8 | openssl-dev \ 9 | gcc \ 10 | linux-headers 11 | 12 | RUN python3 -m venv /venv && \ 13 | source /venv/bin/activate && \ 14 | pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 15 | pip install ./helix_scripts-*-py3-none-any.whl && \ 16 | rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | FROM library/alpine:3.21 19 | 20 | # Install .NET and test dependencies 21 | RUN apk add --upgrade --no-cache \ 22 | bash \ 23 | coreutils \ 24 | curl \ 25 | icu-data-full \ 26 | icu-libs \ 27 | iputils \ 28 | krb5-libs \ 29 | libmsquic \ 30 | lldb \ 31 | llvm \ 32 | lttng-ust \ 33 | musl-locales \ 34 | numactl \ 35 | openssl \ 36 | python3 \ 37 | python3-dev \ 38 | py3-pip \ 39 | sudo \ 40 | tzdata 41 | 42 | # Needed for runtime tests to pass 43 | ENV LANG=en-US.UTF-8 44 | RUN echo export LANG=${LANG} >> /etc/profile.d/locale.sh 45 | 46 | # create helixbot user and give rights to sudo without password 47 | # Alpine does not support long options 48 | RUN /usr/sbin/adduser -D -g '' -G adm -s /bin/bash -u 1000 helixbot && \ 49 | chmod 755 /root && \ 50 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 51 | 52 | USER helixbot 53 | 54 | # Install Helix Dependencies 55 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 56 | RUN python3 -m venv $VIRTUAL_ENV 57 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 58 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 59 | -------------------------------------------------------------------------------- /src/alpine/3.22/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/alpine:3.22 AS venv 2 | 3 | RUN apk add --upgrade --no-cache \ 4 | cargo \ 5 | python3-dev \ 6 | build-base \ 7 | libffi-dev \ 8 | openssl-dev \ 9 | gcc \ 10 | linux-headers 11 | 12 | RUN python3 -m venv /venv && \ 13 | source /venv/bin/activate && \ 14 | pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 15 | pip install ./helix_scripts-*-py3-none-any.whl && \ 16 | rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | FROM library/alpine:3.22 19 | 20 | # Install .NET and test dependencies 21 | RUN apk add --upgrade --no-cache \ 22 | bash \ 23 | coreutils \ 24 | curl \ 25 | icu-data-full \ 26 | icu-libs \ 27 | iputils \ 28 | krb5-libs \ 29 | libmsquic \ 30 | lldb \ 31 | llvm \ 32 | lttng-ust \ 33 | musl-locales \ 34 | numactl \ 35 | openssl \ 36 | python3 \ 37 | python3-dev \ 38 | py3-pip \ 39 | sudo \ 40 | tzdata 41 | 42 | # create helixbot user and give rights to sudo without password 43 | # Alpine does not support long options 44 | RUN /usr/sbin/adduser -D -g '' -G adm -s /bin/bash -u 1000 helixbot && \ 45 | chmod 755 /root && \ 46 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 47 | 48 | USER helixbot 49 | 50 | # Install Helix Dependencies 51 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 52 | RUN python3 -m venv $VIRTUAL_ENV 53 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 54 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 55 | -------------------------------------------------------------------------------- /src/alpine/edge/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/alpine:edge AS venv 2 | 3 | RUN apk add --upgrade --no-cache \ 4 | cargo \ 5 | python3-dev \ 6 | build-base \ 7 | libffi-dev \ 8 | openssl-dev \ 9 | gcc \ 10 | linux-headers 11 | 12 | RUN python3 -m venv /venv && \ 13 | source /venv/bin/activate && \ 14 | pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 15 | pip install ./helix_scripts-*-py3-none-any.whl && \ 16 | rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | FROM library/alpine:edge 19 | 20 | # Install .NET and test dependencies 21 | RUN apk add --upgrade --no-cache \ 22 | bash \ 23 | coreutils \ 24 | curl \ 25 | icu-data-full \ 26 | icu-libs \ 27 | iputils \ 28 | krb5-libs \ 29 | libmsquic \ 30 | lldb \ 31 | llvm \ 32 | lttng-ust \ 33 | musl-locales \ 34 | numactl \ 35 | openssl \ 36 | python3 \ 37 | python3-dev \ 38 | py3-pip \ 39 | sudo \ 40 | tzdata 41 | 42 | # create helixbot user and give rights to sudo without password 43 | # Alpine does not support long options 44 | RUN /usr/sbin/adduser -D -g '' -G adm -s /bin/bash -u 1000 helixbot && \ 45 | chmod 755 /root && \ 46 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 47 | 48 | USER helixbot 49 | 50 | # Install Helix Dependencies 51 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 52 | RUN python3 -m venv $VIRTUAL_ENV 53 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 54 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 55 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/docker-testrunner/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile used to create a testrunner image that can perform Docker operations. 2 | # Usage: docker run --rm -v /var/run/docker.sock:/var/run/docker.sock testrunner pwsh -File xyz.ps1 3 | 4 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 5 | 6 | RUN tdnf install -y \ 7 | ca-certificates \ 8 | # Install Docker 9 | moby-engine \ 10 | docker-buildx \ 11 | docker-cli \ 12 | # Test dependencies 13 | azure-cli \ 14 | git \ 15 | powershell \ 16 | shadow-utils \ 17 | && tdnf clean all 18 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 as venv 2 | 3 | RUN tdnf install --refresh -y \ 4 | build-essential \ 5 | ca-certificates-microsoft \ 6 | gcc \ 7 | iputils \ 8 | python3 \ 9 | python3-devel \ 10 | python3-pip 11 | 12 | RUN python3 -m venv /venv && \ 13 | source /venv/bin/activate && \ 14 | pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 15 | pip install ./helix_scripts-*-py3-none-any.whl && \ 16 | rm ./helix_scripts-*-py3-none-any.whl 17 | 18 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 19 | 20 | # Install .NET and test dependencies 21 | RUN tdnf install --setopt tsflags=nodocs --refresh -y \ 22 | ca-certificates-microsoft \ 23 | icu \ 24 | iputils \ 25 | libgcc-atomic \ 26 | libmsquic \ 27 | libnuma \ 28 | llvm \ 29 | python3 \ 30 | python3-pip \ 31 | shadow-utils \ 32 | sudo \ 33 | tar \ 34 | tzdata \ 35 | which \ 36 | && tdnf clean all 37 | 38 | # create helixbot user and give rights to sudo without password 39 | RUN /usr/sbin/useradd -c '' --uid 1000 --shell /bin/bash --groups adm helixbot && \ 40 | chmod 755 /root && \ 41 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot && \ 42 | mkdir /home/helixbot/ && chown -R helixbot /home/helixbot/ 43 | 44 | USER helixbot 45 | 46 | # Install Helix Dependencies 47 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 48 | RUN python3 -m venv $VIRTUAL_ENV 49 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 50 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 51 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ANDROID_SDK_ROOT=/usr/local/android-sdk 2 | ARG ANDROID_NDK_VERSION=27.2.12479018 3 | ARG ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION 4 | FROM mcr.microsoft.com/openjdk/jdk:17-mariner AS android-sdk-download 5 | ARG ANDROID_SDK_ROOT 6 | ARG ANDROID_NDK_VERSION 7 | ARG ANDROID_NDK_ROOT 8 | 9 | # Dependencies for Android SDK install 10 | RUN tdnf update -y \ 11 | && tdnf install -y \ 12 | # Android dependencies 13 | wget \ 14 | zip \ 15 | unzip 16 | 17 | # Grab the necessary Android SDK packages / tools 18 | RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \ 19 | && echo "2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 commandlinetools-linux-11076708_latest.zip" | sha256sum -c \ 20 | && mkdir -p /usr/local/cmdline-tools \ 21 | && unzip commandlinetools-linux-11076708_latest.zip -d /usr/local/cmdline-tools \ 22 | && rm -f commandlinetools-linux-11076708_latest.zip \ 23 | && yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --licenses 24 | 25 | RUN yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses 26 | RUN /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --install "build-tools;33.0.0" "platforms;android-33" "ndk;${ANDROID_NDK_VERSION}" 27 | 28 | # Remove all components of NDK that are flagged by security scanners 29 | RUN rm -r ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/python3/lib/python3.11/site-packages/ 30 | 31 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 32 | 33 | # Install Microsoft OpenJDK from the Microsoft OpenJDK 17 Mariner image. 34 | ENV LANG=en_US.UTF-8 35 | ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17 36 | ENV PATH=$JAVA_HOME/bin:$PATH 37 | COPY --from=mcr.microsoft.com/openjdk/jdk:17-mariner $JAVA_HOME $JAVA_HOME 38 | ARG ANDROID_SDK_ROOT 39 | ARG ANDROID_NDK_VERSION 40 | ARG ANDROID_NDK_ROOT 41 | 42 | 43 | # Dependencies for Android build 44 | RUN tdnf update -y \ 45 | && tdnf install -y \ 46 | # Common dependencies 47 | binutils \ 48 | # Android dependencies 49 | zip \ 50 | unzip \ 51 | # linux-bionic build dependencies 52 | openssl-devel 53 | 54 | ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT} 55 | ENV ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT} 56 | 57 | COPY --from=android-sdk-download $ANDROID_SDK_ROOT $ANDROID_SDK_ROOT 58 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/android/docker/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-android-amd64 2 | 3 | RUN tdnf update -y \ 4 | && tdnf install -y \ 5 | moby-engine \ 6 | moby-cli 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-azurelinux3.0 2 | 3 | RUN tdnf install -y \ 4 | awk \ 5 | azure-cli \ 6 | # added to ensure latest patches over the base image 7 | curl \ 8 | git \ 9 | nodejs \ 10 | powershell \ 11 | # provides 'useradd', required by Azure DevOps 12 | shadow-utils \ 13 | tar \ 14 | # Provides 'su', required by Azure DevOps 15 | util-linux \ 16 | && tdnf clean all 17 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/amd64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh x64 alpine3.17 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="x86_64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-amd64 AS crossrootx64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-android-amd64 4 | 5 | # Copy crossrootfs from AMD64 build image, so we can build Android-targeting code for that arch 6 | COPY --from=crossrootx64 /crossrootfs/x64 /crossrootfs/x64 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/android/openssl/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-android-amd64 2 | 3 | # Copy the OpenSSL headers and libs from the x64 rootfs into the Anroid NDK so dotnet/runtime's 4 | # OpenSSL headers hack can find them for the linux-bionic build. 5 | RUN mkdir -p ${ANDROID_NDK_ROOT}/usr/local/include && \ 6 | mkdir ${ANDROID_NDK_ROOT}/usr/local/lib && \ 7 | cp -r /crossrootfs/x64/usr/include/openssl ${ANDROID_NDK_ROOT}/usr/local/include/openssl && \ 8 | cp -r /crossrootfs/x64/usr/include/x86_64-linux-gnu/openssl ${ANDROID_NDK_ROOT}/usr/local/include && \ 9 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libssl.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libssl.so && \ 10 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libcrypto.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libcrypto.so 11 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/arm-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm alpine3.17 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="armv7-alpine-linux-musleabihf" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/arm64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm64 alpine3.17 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="aarch64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/armv6/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/armv6 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install raspbian package signing keys 7 | RUN wget http://raspbian.raspberrypi.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2.tar.gz && \ 8 | echo "b3f22fa8d63d8d2f8b81f77784c3dc8f65fd6a10eadda63ac30a2da483ffc9d6ac72d0b5d3d0d5bdf2a61ca264a26fa071aed3acc780f062c8ab27a2e5ac6d49 raspbian-archive-keyring_20120528.2.tar.gz" | sha512sum -c && \ 9 | tar xf raspbian-archive-keyring_20120528.2.tar.gz && \ 10 | mv raspbian-archive-keyring-20120528.2/keyrings/raspbian-archive-keyring.gpg /usr/share/keyrings/ && \ 11 | rm -r raspbian-archive-keyring_20120528.2.tar.gz raspbian-archive-keyring-20120528.2 12 | 13 | RUN /scripts/eng/common/cross/build-rootfs.sh armv6 bookworm no-lldb 14 | 15 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 16 | ARG ROOTFS_DIR 17 | 18 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 19 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/freebsd/14/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install packages needed by the FreeBSD bootstrap scripts 7 | RUN tdnf install -y \ 8 | awk \ 9 | m4 && \ 10 | # The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 11 | # so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 12 | ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so 13 | 14 | RUN /scripts/eng/common/cross/build-rootfs.sh freebsd14 x64 15 | 16 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 17 | ARG ROOTFS_DIR 18 | 19 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 20 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/freebsd/14/arm64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install packages needed by the FreeBSD bootstrap scripts 7 | RUN tdnf install -y \ 8 | awk \ 9 | m4 \ 10 | # The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 11 | # so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 12 | && ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so 13 | 14 | RUN /scripts/eng/common/cross/build-rootfs.sh freebsd14 arm64 15 | 16 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 17 | ARG ROOTFS_DIR 18 | 19 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 20 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/loongarch64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/loongarch64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh loongarch64 alpineedge --skipemulation 7 | 8 | RUN TARGET_TRIPLE="loongarch64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/ppc64le/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/ppc64le 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic ppc64le 7 | 8 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 9 | ARG ROOTFS_DIR 10 | 11 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 12 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/riscv64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/riscv64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 alpine3.20 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="riscv64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/s390x/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/s390x 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic s390x 7 | 8 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 9 | ARG ROOTFS_DIR 10 | 11 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 12 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/cross/x86/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x86 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # We don't ship linux-x86 binaries, so we don't need to make a custom libc++ build for servicing concerns. 7 | # We don't sanitize or instrument the linux-x64 build (as we don't ship it), so we don't need to build those runtime support libraries either. 8 | RUN /scripts/eng/common/cross/build-rootfs.sh x86 bionic --skipunmount 9 | 10 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 11 | ARG ROOTFS_DIR 12 | 13 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 14 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/crossdeps-llvm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-amd64 4 | 5 | # dummy change to trigger cross/ images build after llvm update 6 | 7 | # Install LLVM that we built from source 8 | COPY --from=builder /opt/llvm /usr/local 9 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/crossdeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | # Provides 'su', required by Azure DevOps 6 | ca-certificates \ 7 | git \ 8 | pigz \ 9 | shadow-utils \ 10 | util-linux \ 11 | wget \ 12 | # Common runtime build dependencies 13 | awk \ 14 | cpio \ 15 | file \ 16 | gcc \ 17 | make \ 18 | cmake \ 19 | diffutils \ 20 | icu \ 21 | tar \ 22 | # Crosscomponents build dependencies 23 | glibc-devel \ 24 | kernel-headers \ 25 | lttng-ust-devel \ 26 | # Jit rolling build dependency 27 | python3-pip \ 28 | # aspnetcore build dependencies 29 | nodejs \ 30 | npm \ 31 | # Provides functionality for AzureCLI AzDO task 32 | azure-cli \ 33 | powershell 34 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/fpm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | RUN tdnf install -y \ 3 | awk \ 4 | build-essential \ 5 | ca-certificates \ 6 | git \ 7 | icu \ 8 | rpm-build \ 9 | ruby \ 10 | # Provides useradd 11 | shadow-utils \ 12 | tar \ 13 | # Provides su 14 | util-linux \ 15 | # Provides sudo 16 | sudo \ 17 | && tdnf clean all \ 18 | && gem install fpm 19 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/source-build-test/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:10.0-azurelinux3.0-amd64 AS installer 2 | 3 | # Install dependencies for building pyicu wheel from source (dependency of scancode-toolkit) 4 | RUN tdnf update -y \ 5 | && tdnf install -y \ 6 | binutils \ 7 | gcc-c++ \ 8 | glibc-devel \ 9 | icu-devel \ 10 | kernel-headers \ 11 | python3-devel \ 12 | && tdnf clean all 13 | 14 | # Include scancode 15 | # Install instructions: https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#installation-as-a-library-via-pip 16 | # See latest release at https://github.com/nexB/scancode-toolkit/releases 17 | RUN SCANCODE_VERSION="32.4.1" \ 18 | && python3 -m venv /venv \ 19 | && source /venv/bin/activate \ 20 | && pip install scancode-toolkit==$SCANCODE_VERSION 21 | 22 | 23 | FROM mcr.microsoft.com/dotnet/sdk:10.0-azurelinux3.0-amd64 24 | 25 | COPY --from=installer /venv /venv 26 | 27 | # Install necessary dependencies 28 | RUN tdnf update -y \ 29 | && tdnf install -y \ 30 | libgomp \ 31 | shadow-utils \ 32 | util-linux \ 33 | && tdnf clean all 34 | 35 | # Setup a script which executes scancode in the virtual environment 36 | COPY ./run-scancode.sh /usr/local/bin/scancode 37 | RUN chmod +x /usr/local/bin/scancode -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/source-build-test/amd64/run-scancode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | source /venv/bin/activate 4 | scancode "$@" 5 | deactivate -------------------------------------------------------------------------------- /src/azurelinux/3.0/net10.0/webassembly/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-amd64 2 | 3 | # Dependencies for WebAssembly build 4 | RUN tdnf update -y \ 5 | && tdnf install -y \ 6 | # WebAssembly build dependencies 7 | which \ 8 | nodejs \ 9 | npm \ 10 | pigz \ 11 | python3 \ 12 | libxml2 \ 13 | unzip 14 | 15 | # WebAssembly build needs typescript 16 | RUN npm i -g typescript 17 | 18 | # Install V8 Engine 19 | SHELL ["/bin/bash", "-c"] 20 | 21 | ENV V8_VERSION=10.8.168 22 | RUN curl -sSL https://netcorenativeassets.blob.core.windows.net/resource-packages/external/linux/chromium-v8/v8-linux64-rel-${V8_VERSION}.zip -o ./v8.zip \ 23 | && unzip ./v8.zip -d /usr/local/v8 \ 24 | && echo $'#!/usr/bin/env bash\n\ 25 | "/usr/local/v8/d8" --snapshot_blob="/usr/local/v8/snapshot_blob.bin" "$@"\n' > /usr/local/bin/v8 \ 26 | && chmod +x /usr/local/bin/v8 27 | 28 | # Install Wasi toolchain 29 | ENV WASI_SDK_MAJOR_VERSION=25 30 | ENV WASI_SDK_VERSION=${WASI_SDK_MAJOR_VERSION}.0 31 | ENV WASI_SDK_PATH=/usr/local/wasi-sdk 32 | ENV WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_MAJOR_VERSION}/wasi-sdk-${WASI_SDK_VERSION}-x86_64-linux.tar.gz 33 | 34 | RUN mkdir -p ${WASI_SDK_PATH} \ 35 | && cd /tmp \ 36 | && curl -L -o /tmp/wasi-sdk.tar.gz ${WASI_SDK_URL} \ 37 | && tar --strip-components=1 -xvzf /tmp/wasi-sdk.tar.gz -C ${WASI_SDK_PATH} \ 38 | && echo ${WASI_SDK_VERSION} > ${WASI_SDK_PATH}/wasi-sdk-version.txt \ 39 | && echo ${WASI_SDK_VERSION} > ${WASI_SDK_PATH}/WASI-SDK-VERSION-${WASI_SDK_VERSION} \ 40 | && rm /tmp/wasi-sdk.tar.gz 41 | 42 | ENV WASMTIME_VERSION=27.0.0 43 | ENV WASMTIME_PATH=/usr/local/wasmtime 44 | ENV WASMTIME_URL=https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-x86_64-linux.tar.xz 45 | 46 | RUN mkdir -p ${WASMTIME_PATH} \ 47 | && cd /tmp \ 48 | && curl -L -o /tmp/wasmtime.tar.xz ${WASMTIME_URL} \ 49 | && tar --strip-components=1 -xvf /tmp/wasmtime.tar.xz -C ${WASMTIME_PATH} \ 50 | && echo ${WASMTIME_VERSION} > ${WASMTIME_PATH}/wasmtime-version.txt \ 51 | && rm /tmp/wasmtime.tar.xz \ 52 | && ln -s ${WASMTIME_PATH}/wasmtime /bin/wasmtime 53 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ANDROID_SDK_ROOT=/usr/local/android-sdk 2 | ARG ANDROID_NDK_VERSION=27.2.12479018 3 | ARG ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION 4 | FROM mcr.microsoft.com/openjdk/jdk:17-mariner AS android-sdk-download 5 | ARG ANDROID_SDK_ROOT 6 | ARG ANDROID_NDK_VERSION 7 | ARG ANDROID_NDK_ROOT 8 | 9 | # Dependencies for Android SDK install 10 | RUN tdnf update -y \ 11 | && tdnf install -y \ 12 | # Android dependencies 13 | wget \ 14 | zip \ 15 | unzip 16 | 17 | # Grab the necessary Android SDK packages / tools 18 | RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \ 19 | && echo "2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 commandlinetools-linux-11076708_latest.zip" | sha256sum -c \ 20 | && mkdir -p /usr/local/cmdline-tools \ 21 | && unzip commandlinetools-linux-11076708_latest.zip -d /usr/local/cmdline-tools \ 22 | && rm -f commandlinetools-linux-11076708_latest.zip \ 23 | && yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --licenses 24 | 25 | RUN yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses 26 | RUN /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --install "build-tools;33.0.0" "platforms;android-33" "ndk;${ANDROID_NDK_VERSION}" 27 | 28 | # Remove all components of NDK 27 that are flagged by security scanners 29 | RUN rm -r ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/python3/lib/python3.11/site-packages/ 30 | 31 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 32 | 33 | # Install Microsoft OpenJDK from the Microsoft OpenJDK 17 Mariner image. 34 | ENV LANG=en_US.UTF-8 35 | ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17 36 | ENV PATH=$JAVA_HOME/bin:$PATH 37 | COPY --from=mcr.microsoft.com/openjdk/jdk:17-mariner $JAVA_HOME $JAVA_HOME 38 | ARG ANDROID_SDK_ROOT 39 | ARG ANDROID_NDK_VERSION 40 | ARG ANDROID_NDK_ROOT 41 | 42 | 43 | # Dependencies for Android build 44 | RUN tdnf update -y \ 45 | && tdnf install -y \ 46 | # Common dependencies 47 | binutils \ 48 | # Android dependencies 49 | zip \ 50 | unzip \ 51 | # linux-bionic build dependencies 52 | openssl-devel 53 | 54 | ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT} 55 | ENV ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT} 56 | 57 | COPY --from=android-sdk-download $ANDROID_SDK_ROOT $ANDROID_SDK_ROOT 58 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/android/docker/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-amd64 2 | 3 | RUN tdnf update -y \ 4 | && tdnf install -y \ 5 | moby-engine \ 6 | moby-cli 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-azurelinux3.0 2 | 3 | RUN tdnf install -y \ 4 | awk \ 5 | azure-cli \ 6 | # added to ensure latest patches over the base image 7 | curl \ 8 | git \ 9 | nodejs \ 10 | powershell \ 11 | # provides 'useradd', required by Azure DevOps 12 | shadow-utils \ 13 | tar \ 14 | # Provides 'su', required by Azure DevOps 15 | util-linux \ 16 | && tdnf clean all 17 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/amd64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh x64 alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64 AS crossrootx64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-amd64 4 | 5 | # Copy crossrootfs from AMD64 build image, so we can build Android-targeting code for that arch 6 | COPY --from=crossrootx64 /crossrootfs/x64 /crossrootfs/x64 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/android/openssl/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-android-amd64 2 | 3 | # Copy the OpenSSL headers and libs from the x64 rootfs into the Anroid NDK so dotnet/runtime's 4 | # OpenSSL headers hack can find them for the linux-bionic build. 5 | RUN mkdir -p ${ANDROID_NDK_ROOT}/usr/local/include && \ 6 | mkdir ${ANDROID_NDK_ROOT}/usr/local/lib && \ 7 | cp -r /crossrootfs/x64/usr/include/openssl ${ANDROID_NDK_ROOT}/usr/local/include/openssl && \ 8 | cp -r /crossrootfs/x64/usr/include/x86_64-linux-gnu/openssl ${ANDROID_NDK_ROOT}/usr/local/include && \ 9 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libssl.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libssl.so && \ 10 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libcrypto.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libcrypto.so 11 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/arm-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/arm64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm64 alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/freebsd/14/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install packages needed by the FreeBSD bootstrap scripts 7 | RUN tdnf install -y \ 8 | awk \ 9 | m4 && \ 10 | # The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 11 | # so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 12 | ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so 13 | 14 | RUN /scripts/eng/common/cross/build-rootfs.sh freebsd14 x64 15 | 16 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 17 | ARG ROOTFS_DIR 18 | 19 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 20 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/ppc64le/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/ppc64le 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic ppc64le 7 | 8 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 9 | ARG ROOTFS_DIR 10 | 11 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 12 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/cross/s390x/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/s390x 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic s390x 7 | 8 | # build ld from binutils since llvm's lld only supports s390x since 18.0 but we're using 16.0 9 | # this can be removed once crossdeps-builder switches to llvm 18.0 10 | RUN tdnf install -y awk && \ 11 | wget https://sourceware.org/pub/binutils/snapshots/binutils-2.41.90.tar.xz -O binutils.tar.xz && \ 12 | echo "6e990c6e40000acedb9928fa6b6a32a164f3119740a95c40e7a85c6461dbdda5 binutils.tar.xz" | sha256sum -c && \ 13 | mkdir binutils.src && \ 14 | tar -xf binutils.tar.xz --directory=binutils.src --strip-components=1 && \ 15 | cd binutils.src && \ 16 | ./configure --target=s390x-linux-gnu --prefix=/binutils.install --disable-nls --disable-werror && \ 17 | make -j $(getconf _NPROCESSORS_ONLN) && \ 18 | make install -C ld 19 | 20 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 21 | ARG ROOTFS_DIR 22 | 23 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 24 | COPY --from=builder /binutils.install/s390x-linux-gnu/bin/ld /usr/local/bin/s390x-linux-gnu-ld 25 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/crossdeps-llvm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-amd64 4 | 5 | # Install LLVM that we built from source 6 | COPY --from=builder /opt/llvm /usr/local 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/crossdeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | ca-certificates \ 6 | git \ 7 | shadow-utils \ 8 | # Provides 'su', required by Azure DevOps 9 | util-linux \ 10 | wget \ 11 | # Common runtime build dependencies 12 | awk \ 13 | gcc \ 14 | make \ 15 | cmake \ 16 | diffutils \ 17 | icu \ 18 | tar \ 19 | zlib-devel \ 20 | # Crosscomponents build dependencies 21 | glibc-devel \ 22 | kernel-headers \ 23 | lttng-ust-devel \ 24 | # Jit rolling build dependency 25 | python3-pip \ 26 | # aspnetcore build dependencies 27 | nodejs \ 28 | npm \ 29 | # Provides functionality for AzureCLI AzDO task 30 | azure-cli \ 31 | powershell 32 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net8.0/fpm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | RUN tdnf install -y \ 3 | awk \ 4 | build-essential \ 5 | ca-certificates \ 6 | git \ 7 | icu \ 8 | rpm-build \ 9 | ruby \ 10 | # Provides useradd 11 | shadow-utils \ 12 | tar \ 13 | # Provides su 14 | util-linux \ 15 | # Provides sudo 16 | sudo \ 17 | # Provides functionality for AzureCLI AzDO task 18 | azure-cli \ 19 | powershell \ 20 | && tdnf clean all \ 21 | && gem install fpm 22 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ANDROID_SDK_ROOT=/usr/local/android-sdk 2 | ARG ANDROID_NDK_VERSION=27.2.12479018 3 | ARG ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION 4 | FROM mcr.microsoft.com/openjdk/jdk:17-mariner AS android-sdk-download 5 | ARG ANDROID_SDK_ROOT 6 | ARG ANDROID_NDK_VERSION 7 | ARG ANDROID_NDK_ROOT 8 | 9 | # Dependencies for Android SDK install 10 | RUN tdnf update -y \ 11 | && tdnf install -y \ 12 | # Android dependencies 13 | wget \ 14 | zip \ 15 | unzip 16 | 17 | # Grab the necessary Android SDK packages / tools 18 | RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \ 19 | && echo "2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 commandlinetools-linux-11076708_latest.zip" | sha256sum -c \ 20 | && mkdir -p /usr/local/cmdline-tools \ 21 | && unzip commandlinetools-linux-11076708_latest.zip -d /usr/local/cmdline-tools \ 22 | && rm -f commandlinetools-linux-11076708_latest.zip \ 23 | && yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --licenses 24 | 25 | RUN yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses 26 | RUN /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --install "build-tools;33.0.0" "platforms;android-33" "ndk;${ANDROID_NDK_VERSION}" 27 | 28 | # Remove all components of NDK that are flagged by security scanners 29 | RUN rm -r ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/python3/lib/python3.11/site-packages/ 30 | 31 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 32 | 33 | # Install Microsoft OpenJDK from the Microsoft OpenJDK 17 Mariner image. 34 | ENV LANG=en_US.UTF-8 35 | ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17 36 | ENV PATH=$JAVA_HOME/bin:$PATH 37 | COPY --from=mcr.microsoft.com/openjdk/jdk:17-mariner $JAVA_HOME $JAVA_HOME 38 | ARG ANDROID_SDK_ROOT 39 | ARG ANDROID_NDK_VERSION 40 | ARG ANDROID_NDK_ROOT 41 | 42 | 43 | # Dependencies for Android build 44 | RUN tdnf update -y \ 45 | && tdnf install -y \ 46 | # Common dependencies 47 | binutils \ 48 | # Android dependencies 49 | zip \ 50 | unzip \ 51 | # linux-bionic build dependencies 52 | openssl-devel 53 | 54 | ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT} 55 | ENV ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT} 56 | 57 | COPY --from=android-sdk-download $ANDROID_SDK_ROOT $ANDROID_SDK_ROOT 58 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/android/docker/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-amd64 2 | 3 | RUN tdnf update -y \ 4 | && tdnf install -y \ 5 | moby-engine \ 6 | moby-cli 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/build/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-azurelinux3.0 2 | 3 | RUN tdnf install -y \ 4 | awk \ 5 | azure-cli \ 6 | # added to ensure latest patches over the base image 7 | curl \ 8 | git \ 9 | nodejs \ 10 | powershell \ 11 | # provides 'useradd', required by Azure DevOps 12 | shadow-utils \ 13 | tar \ 14 | # Provides 'su', required by Azure DevOps 15 | util-linux \ 16 | && tdnf clean all 17 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/amd64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh x64 alpine3.13 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="x86_64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64 AS crossrootx64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-amd64 4 | 5 | # Copy crossrootfs from AMD64 build image, so we can build Android-targeting code for that arch 6 | COPY --from=crossrootx64 /crossrootfs/x64 /crossrootfs/x64 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/android/openssl/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-android-amd64 2 | 3 | # Copy the OpenSSL headers and libs from the x64 rootfs into the Anroid NDK so dotnet/runtime's 4 | # OpenSSL headers hack can find them for the linux-bionic build. 5 | RUN mkdir -p ${ANDROID_NDK_ROOT}/usr/local/include && \ 6 | mkdir ${ANDROID_NDK_ROOT}/usr/local/lib && \ 7 | cp -r /crossrootfs/x64/usr/include/openssl ${ANDROID_NDK_ROOT}/usr/local/include/openssl && \ 8 | cp -r /crossrootfs/x64/usr/include/x86_64-linux-gnu/openssl ${ANDROID_NDK_ROOT}/usr/local/include && \ 9 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libssl.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libssl.so && \ 10 | cp -r $(readlink -f /crossrootfs/x64/usr/lib/x86_64-linux-gnu/libcrypto.so) ${ANDROID_NDK_ROOT}/usr/local/lib/libcrypto.so 11 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/arm-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm alpine3.13 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="armv7-alpine-linux-musleabihf" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/arm64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm64 alpine3.13 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="aarch64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/armv6/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/armv6 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install raspbian package signing keys 7 | RUN wget http://raspbian.raspberrypi.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2.tar.gz && \ 8 | echo "b3f22fa8d63d8d2f8b81f77784c3dc8f65fd6a10eadda63ac30a2da483ffc9d6ac72d0b5d3d0d5bdf2a61ca264a26fa071aed3acc780f062c8ab27a2e5ac6d49 raspbian-archive-keyring_20120528.2.tar.gz" | sha512sum -c && \ 9 | tar xf raspbian-archive-keyring_20120528.2.tar.gz && \ 10 | mv raspbian-archive-keyring-20120528.2/keyrings/raspbian-archive-keyring.gpg /usr/share/keyrings/ && \ 11 | rm -r raspbian-archive-keyring_20120528.2.tar.gz raspbian-archive-keyring-20120528.2 12 | 13 | RUN /scripts/eng/common/cross/build-rootfs.sh armv6 bookworm no-lldb 14 | 15 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 16 | ARG ROOTFS_DIR 17 | 18 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 19 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/freebsd/14/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install packages needed by the FreeBSD bootstrap scripts 7 | RUN tdnf install -y \ 8 | awk \ 9 | m4 && \ 10 | # The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 11 | # so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 12 | ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so 13 | 14 | RUN /scripts/eng/common/cross/build-rootfs.sh freebsd14 x64 15 | 16 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 17 | ARG ROOTFS_DIR 18 | 19 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 20 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/freebsd/14/arm64/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Install packages needed by the FreeBSD bootstrap scripts 7 | RUN tdnf install -y \ 8 | awk \ 9 | m4 \ 10 | # The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 11 | # so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 12 | && ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so 13 | 14 | RUN /scripts/eng/common/cross/build-rootfs.sh freebsd14 arm64 15 | 16 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 17 | ARG ROOTFS_DIR 18 | 19 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 20 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/ppc64le/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/ppc64le 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic ppc64le 7 | 8 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 9 | ARG ROOTFS_DIR 10 | 11 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 12 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/riscv64-musl/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/riscv64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 alpine3.20 --skipunmount 7 | 8 | RUN TARGET_TRIPLE="riscv64-alpine-linux-musl" && \ 9 | GCC_VER=$(basename "$(find "$ROOTFS_DIR/usr/include/c++/" -mindepth 1 -maxdepth 1 -type d | sort -V | head -n1)") && \ 10 | CPP_INCLUDES="$ROOTFS_DIR/usr/include/c++/$GCC_VER" && \ 11 | TRIPLET_INCLUDES=$([ -e "$CPP_INCLUDES/$TARGET_TRIPLE" ] && echo "$CPP_INCLUDES/$TARGET_TRIPLE" || echo "$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE");$(realpath "$CPP_INCLUDES/../../$TARGET_TRIPLE/c++/$GCC_VER")") && \ 12 | echo "Using C++ includes $CPP_INCLUDES and $TRIPLET_INCLUDES to build for $TARGET_TRIPLE" && \ 13 | cmake -S llvm-project.src/runtimes -B runtimes \ 14 | -DCMAKE_BUILD_TYPE=Release \ 15 | -DCMAKE_ASM_COMPILER=clang \ 16 | -DCMAKE_C_COMPILER=clang \ 17 | -DCMAKE_CXX_COMPILER=clang++ \ 18 | -DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ 19 | -DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ 20 | -DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ 21 | # We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. 22 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ 23 | -DCMAKE_SYSROOT="$ROOTFS_DIR" \ 24 | # Specify linker to use for exes directly for CMake toolchain detection 25 | -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ 26 | # Don't search for tools in the sysroot as we're cross-compiling 27 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ 28 | -DLLVM_USE_LINKER=lld \ 29 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ 30 | -DLIBCXX_ENABLE_SHARED=OFF \ 31 | -DLIBCXX_HAS_MUSL_LIBC=ON \ 32 | -DLIBCXX_CXX_ABI=libstdc++ \ 33 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$CPP_INCLUDES;$TRIPLET_INCLUDES" && \ 34 | cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ 35 | cmake --install runtimes --prefix "$ROOTFS_DIR/usr" 36 | 37 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 38 | ARG ROOTFS_DIR 39 | 40 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 41 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/s390x/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/s390x 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh bionic s390x 7 | 8 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 9 | ARG ROOTFS_DIR 10 | 11 | COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" 12 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/cross/x86/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x86 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # We don't ship linux-x86 binaries, so we don't need to make a custom libc++ build for servicing concerns. 7 | # We don't sanitize or instrument the linux-x64 build (as we don't ship it), so we don't need to build those runtime support libraries either. 8 | RUN /scripts/eng/common/cross/build-rootfs.sh x86 xenial --skipunmount 9 | 10 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-llvm-amd64 11 | ARG ROOTFS_DIR 12 | 13 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 14 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/crossdeps-llvm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-builder-amd64 AS builder 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-crossdeps-amd64 4 | 5 | # Install LLVM that we built from source 6 | COPY --from=builder /opt/llvm /usr/local 7 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/crossdeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | ca-certificates \ 6 | git \ 7 | pigz \ 8 | shadow-utils \ 9 | # Provides 'su', required by Azure DevOps 10 | util-linux \ 11 | wget \ 12 | # Common runtime build dependencies 13 | awk \ 14 | cpio \ 15 | file \ 16 | gcc \ 17 | make \ 18 | cmake \ 19 | diffutils \ 20 | icu \ 21 | tar \ 22 | # Crosscomponents build dependencies 23 | glibc-devel \ 24 | kernel-headers \ 25 | lttng-ust-devel \ 26 | # Jit rolling build dependency 27 | python3-pip \ 28 | # aspnetcore build dependencies 29 | nodejs \ 30 | npm \ 31 | # Provides functionality for AzureCLI AzDO task 32 | azure-cli \ 33 | powershell 34 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/fpm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | RUN tdnf install -y \ 3 | awk \ 4 | build-essential \ 5 | ca-certificates \ 6 | git \ 7 | icu \ 8 | rpm-build \ 9 | ruby \ 10 | # Provides useradd 11 | shadow-utils \ 12 | tar \ 13 | # Provides su 14 | util-linux \ 15 | # Provides sudo 16 | sudo \ 17 | # Provides functionality for AzureCLI AzDO task 18 | azure-cli \ 19 | powershell \ 20 | && tdnf clean all \ 21 | && gem install fpm 22 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/opt/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azurelinux/base/core:3.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | # Common dependencies 6 | ca-certificates \ 7 | git \ 8 | shadow-utils \ 9 | tar \ 10 | util-linux \ 11 | wget \ 12 | # Runtime dependencies 13 | icu \ 14 | # Optimization dependencies (provides llvm-profdata) 15 | llvm 16 | -------------------------------------------------------------------------------- /src/azurelinux/3.0/net9.0/webassembly/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64 2 | 3 | # Dependencies for WebAssembly build 4 | RUN tdnf update -y \ 5 | && tdnf install -y \ 6 | # WebAssembly build dependencies 7 | which \ 8 | nodejs \ 9 | npm \ 10 | pigz \ 11 | python3 \ 12 | libxml2 \ 13 | unzip 14 | 15 | # WebAssembly build needs typescript 16 | RUN npm i -g typescript 17 | 18 | # Install V8 Engine 19 | SHELL ["/bin/bash", "-c"] 20 | 21 | ENV V8_VERSION=10.8.168 22 | RUN curl -sSL https://netcorenativeassets.blob.core.windows.net/resource-packages/external/linux/chromium-v8/v8-linux64-rel-${V8_VERSION}.zip -o ./v8.zip \ 23 | && unzip ./v8.zip -d /usr/local/v8 \ 24 | && echo $'#!/usr/bin/env bash\n\ 25 | "/usr/local/v8/d8" --snapshot_blob="/usr/local/v8/snapshot_blob.bin" "$@"\n' > /usr/local/bin/v8 \ 26 | && chmod +x /usr/local/bin/v8 27 | 28 | # Install Wasi toolchain 29 | ENV WASI_SDK_VERSION=22 30 | ENV WASI_SDK_PATH=/usr/local/wasi-sdk 31 | ENV WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz 32 | 33 | RUN mkdir -p ${WASI_SDK_PATH} \ 34 | && cd /tmp \ 35 | && curl -L -o /tmp/wasi-sdk.tar.gz ${WASI_SDK_URL} \ 36 | && tar --strip-components=1 -xvzf /tmp/wasi-sdk.tar.gz -C ${WASI_SDK_PATH} \ 37 | && echo ${WASI_SDK_VERSION} > ${WASI_SDK_PATH}/wasi-sdk-version.txt \ 38 | && rm /tmp/wasi-sdk.tar.gz 39 | 40 | ENV WASMTIME_VERSION=19.0.2 41 | ENV WASMTIME_PATH=/usr/local/wasmtime 42 | ENV WASMTIME_URL=https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-x86_64-linux.tar.xz 43 | 44 | RUN mkdir -p ${WASMTIME_PATH} \ 45 | && cd /tmp \ 46 | && curl -L -o /tmp/wasmtime.tar.xz ${WASMTIME_URL} \ 47 | && tar --strip-components=1 -xvf /tmp/wasmtime.tar.xz -C ${WASMTIME_PATH} \ 48 | && echo ${WASMTIME_VERSION} > ${WASMTIME_PATH}/wasmtime-version.txt \ 49 | && rm /tmp/wasmtime.tar.xz \ 50 | && ln -s ${WASMTIME_PATH}/wasmtime /bin/wasmtime 51 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 2 | RUN tdnf install -y \ 3 | autoconf \ 4 | automake \ 5 | build-essential \ 6 | ca-certificates \ 7 | clang \ 8 | cmake \ 9 | doxygen \ 10 | gcc \ 11 | gdb \ 12 | git \ 13 | krb5-devel \ 14 | libcurl-devel \ 15 | libedit-devel \ 16 | libicu-devel \ 17 | libmetalink-devel \ 18 | libnghttp2-devel \ 19 | libssh2-devel \ 20 | libtool \ 21 | libunwind-devel \ 22 | libuuid-devel \ 23 | libxml2-devel \ 24 | lldb-devel \ 25 | lttng-ust-devel \ 26 | lzma \ 27 | make \ 28 | ncurses-devel \ 29 | numactl-devel \ 30 | openssl-devel \ 31 | pkgconf \ 32 | python3 \ 33 | python3-devel \ 34 | readline-devel \ 35 | sed \ 36 | sudo \ 37 | swig \ 38 | tar \ 39 | wget \ 40 | which \ 41 | xz \ 42 | zlib-devel \ 43 | && tdnf clean all 44 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/cross/amd64-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/x64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh x64 alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-llvm 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/cross/android/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64 AS crossrootx64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-android 4 | 5 | # Copy crossrootfs from AMD64 build image, so we can build Android-targeting code for that arch 6 | COPY --from=crossrootx64 /crossrootfs/x64 /crossrootfs/x64 -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/cross/arm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-llvm 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/cross/arm64-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/arm64 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder AS builder 4 | ARG ROOTFS_DIR 5 | 6 | RUN /scripts/eng/common/cross/build-rootfs.sh arm64 alpine3.13 --skipunmount 7 | 8 | 9 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-llvm 10 | ARG ROOTFS_DIR 11 | 12 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 13 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/crossdeps-llvm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder AS builder 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps 4 | 5 | # Install LLVM that we built from source 6 | COPY --from=builder /opt/llvm /usr/local 7 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/crossdeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | ca-certificates \ 6 | git \ 7 | # Provides 'su', required by Azure DevOps 8 | util-linux \ 9 | wget \ 10 | # Common runtime build dependencies 11 | awk \ 12 | cmake \ 13 | diffutils \ 14 | icu \ 15 | tar \ 16 | zlib-devel \ 17 | # Crosscomponents build dependencies 18 | glibc-devel \ 19 | kernel-headers \ 20 | lttng-ust-devel \ 21 | # Jit rolling build dependency 22 | python3-pip \ 23 | # diagnostics build dependency 24 | lldb-devel \ 25 | # Provides functionality for AzureCLI AzDO task 26 | azure-cli \ 27 | powershell 28 | 29 | # Validate checksums with keyring after https://github.com/microsoft/azurelinux/issues/3142 is resolved 30 | ENV NODE_VERSION=22.16.0 31 | RUN mkdir /usr/share/node && \ 32 | curl -O https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt && \ 33 | curl -O -sSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz && \ 34 | grep node-v${NODE_VERSION}-linux-x64.tar.xz SHASUMS256.txt | sha256sum -c - && \ 35 | tar xf node-v${NODE_VERSION}-linux-x64.tar.xz -J -C /usr/share/node --strip-components=1 && \ 36 | ln -s /usr/share/node/bin/node /usr/local/bin/node && \ 37 | ln -s /usr/share/node/bin/npm /usr/local/bin/npm && \ 38 | ln -s /usr/share/node/bin/npx /usr/local/bin/npx && \ 39 | rm SHASUMS256.txt && \ 40 | rm node-v${NODE_VERSION}-linux-x64.tar.xz 41 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/fpm/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 2 | RUN tdnf install -y \ 3 | awk \ 4 | build-essential \ 5 | ca-certificates \ 6 | git \ 7 | icu \ 8 | rpm-build \ 9 | ruby \ 10 | # Provides useradd 11 | shadow-utils \ 12 | tar \ 13 | # Provides su 14 | util-linux \ 15 | # Provides sudo 16 | sudo \ 17 | # Provides functionality for AzureCLI AzDO task 18 | azure-cli \ 19 | powershell \ 20 | && tdnf clean all \ 21 | && gem install fpm 22 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 2 | 3 | # Install Helix Dependencies 4 | 5 | ENV LANG=en_US.utf8 6 | 7 | RUN tdnf install --setopt tsflags=nodocs --refresh -y \ 8 | ca-certificates-microsoft \ 9 | gcc \ 10 | icu \ 11 | iputils \ 12 | libmsquic \ 13 | llvm \ 14 | python3-pip \ 15 | shadow-utils \ 16 | sudo \ 17 | tar \ 18 | tzdata \ 19 | which \ 20 | && tdnf clean all 21 | 22 | RUN ln -sf /usr/bin/python3 /usr/bin/python 23 | 24 | # create helixbot user and give rights to sudo without password 25 | RUN /usr/sbin/useradd -c '' --uid 1000 --shell /bin/bash --groups adm helixbot && \ 26 | chmod 755 /root && \ 27 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot && \ 28 | mkdir /home/helixbot/ && chown -R helixbot /home/helixbot/ 29 | 30 | USER helixbot 31 | WORKDIR /home/helixbot 32 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 33 | 34 | RUN python -m venv $VIRTUAL_ENV && \ 35 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 36 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 37 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ 38 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 39 | rm ./helix_scripts-*-py3-none-any.whl 40 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 41 | -------------------------------------------------------------------------------- /src/cbl-mariner/2.0/opt/arm64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 2 | 3 | RUN tdnf update -y && \ 4 | tdnf install -y \ 5 | # Common dependencies 6 | ca-certificates \ 7 | git \ 8 | tar \ 9 | util-linux \ 10 | wget \ 11 | # Runtime dependencies 12 | icu \ 13 | # Optimization dependencies (provides llvm-profdata) 14 | llvm16 15 | -------------------------------------------------------------------------------- /src/centos-stream/10/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream10 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | && dnf install --setopt tsflags=nodocs -y \ 6 | dnf-plugins-core \ 7 | # rhel/10 packages don't exist yet, so we use the rhel/9 packages 8 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 9 | && dnf config-manager --set-enabled crb \ 10 | && dnf install --setopt tsflags=nodocs -y \ 11 | "perl(Time::HiRes)" \ 12 | autoconf \ 13 | automake \ 14 | brotli-devel \ 15 | clang \ 16 | cmake \ 17 | cpio \ 18 | curl-devel \ 19 | doxygen \ 20 | elfutils \ 21 | file \ 22 | findutils \ 23 | gcc \ 24 | gdb \ 25 | git \ 26 | glibc-langpack-en \ 27 | hostname \ 28 | iproute \ 29 | jq \ 30 | krb5-devel \ 31 | libcurl-devel \ 32 | libedit-devel \ 33 | libicu-devel \ 34 | libidn2-devel \ 35 | libnghttp2-devel \ 36 | libtool \ 37 | libuuid-devel \ 38 | libxml2-devel \ 39 | lld \ 40 | lldb-devel \ 41 | llvm \ 42 | lttng-ust-devel \ 43 | lzma \ 44 | make \ 45 | ncurses-devel \ 46 | numactl-devel \ 47 | openssl \ 48 | openssl-devel \ 49 | pigz \ 50 | powershell \ 51 | procps-ng \ 52 | python3 \ 53 | python3-devel \ 54 | readline-devel \ 55 | sudo \ 56 | swig \ 57 | tar \ 58 | wget \ 59 | which \ 60 | xz \ 61 | zlib-devel \ 62 | && dnf clean all 63 | -------------------------------------------------------------------------------- /src/centos-stream/10/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream10 AS venv 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf install --setopt tsflags=nodocs -y \ 5 | gcc \ 6 | gcc-c++ \ 7 | python3 \ 8 | python3-devel \ 9 | python3-pip 10 | 11 | RUN python3 -m venv /venv \ 12 | && . /venv/bin/activate \ 13 | && pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ 14 | && pip install ./helix_scripts-*-py3-none-any.whl \ 15 | && rm ./helix_scripts-*-py3-none-any.whl 16 | 17 | FROM quay.io/centos/centos:stream10 18 | 19 | # Install dependencies 20 | RUN dnf upgrade --refresh -y \ 21 | && dnf install --setopt tsflags=nodocs -y \ 22 | dnf-plugins-core \ 23 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 24 | && dnf install --setopt tsflags=nodocs -y --allowerasing \ 25 | autoconf \ 26 | automake \ 27 | curl \ 28 | file \ 29 | git-core \ 30 | iputils \ 31 | libicu \ 32 | libmsquic \ 33 | libtool \ 34 | lldb \ 35 | llvm \ 36 | make \ 37 | openssl \ 38 | openssl-devel \ 39 | perl \ 40 | python3 \ 41 | python3-devel \ 42 | python3-pip \ 43 | sudo \ 44 | tar \ 45 | wget \ 46 | which \ 47 | && dnf clean all 48 | 49 | ENV LANG=en_US.utf8 50 | 51 | # create helixbot user and give rights to sudo without password 52 | RUN /usr/sbin/adduser --uid 1000 --shell /bin/bash --gid adm helixbot \ 53 | && chmod 755 /root \ 54 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 55 | 56 | USER helixbot 57 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 58 | 59 | # Install Helix Dependencies 60 | RUN python3 -m venv $VIRTUAL_ENV 61 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 62 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 63 | -------------------------------------------------------------------------------- /src/centos-stream/9/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream9 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | && dnf install --setopt tsflags=nodocs -y \ 6 | dnf-plugins-core \ 7 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 8 | && dnf config-manager --set-enabled crb \ 9 | && dnf module install --setopt tsflags=nodocs -y \ 10 | nodejs:20/common \ 11 | && dnf install --setopt tsflags=nodocs -y \ 12 | "perl(Time::HiRes)" \ 13 | autoconf \ 14 | automake \ 15 | azure-cli \ 16 | brotli-devel \ 17 | clang \ 18 | cmake \ 19 | cpio \ 20 | curl-devel \ 21 | doxygen \ 22 | elfutils \ 23 | file \ 24 | findutils \ 25 | gcc \ 26 | gdb \ 27 | git \ 28 | glibc-langpack-en \ 29 | hostname \ 30 | iproute \ 31 | jq \ 32 | krb5-devel \ 33 | libcurl-devel \ 34 | libedit-devel \ 35 | libicu-devel \ 36 | libidn2-devel \ 37 | libnghttp2-devel \ 38 | libtool \ 39 | libuuid-devel \ 40 | libxml2-devel \ 41 | lld \ 42 | lldb-devel \ 43 | llvm \ 44 | lttng-ust-devel \ 45 | lzma \ 46 | make \ 47 | ncurses-devel \ 48 | numactl-devel \ 49 | openssl-devel \ 50 | pigz \ 51 | powershell \ 52 | procps-ng \ 53 | python3 \ 54 | python3-devel \ 55 | readline-devel \ 56 | sudo \ 57 | swig \ 58 | tar \ 59 | wget \ 60 | which \ 61 | xz \ 62 | zlib-devel \ 63 | && dnf clean all 64 | 65 | ENV \ 66 | NO_UPDATE_NOTIFIER=true \ 67 | # Sha1 is disabled by default centos:stream9 but sevaral CI jobs still rely on it. 68 | OPENSSL_ENABLE_SHA1_SIGNATURES=1 69 | -------------------------------------------------------------------------------- /src/centos-stream/9/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos/centos:stream9 2 | 3 | # Install dependencies 4 | RUN dnf upgrade --refresh -y \ 5 | # Required to install libunwind from the EPEL repo 6 | && dnf install -y epel-release \ 7 | && dnf install --setopt tsflags=nodocs -y \ 8 | dnf-plugins-core \ 9 | && dnf config-manager --add-repo=https://packages.microsoft.com/rhel/9/prod/config.repo \ 10 | && dnf install --setopt tsflags=nodocs -y --allowerasing \ 11 | autoconf \ 12 | automake \ 13 | curl \ 14 | file \ 15 | gcc \ 16 | gcc-c++ \ 17 | gdb \ 18 | git-core \ 19 | iputils \ 20 | libicu \ 21 | libmsquic \ 22 | libtool \ 23 | llvm \ 24 | make \ 25 | openssl \ 26 | openssl-devel \ 27 | perl \ 28 | python3 \ 29 | python3-devel \ 30 | python3-pip \ 31 | sudo \ 32 | tar \ 33 | wget \ 34 | which \ 35 | # NativeAOT and runtime dependencies 36 | zlib-devel \ 37 | libunwind \ 38 | && dnf clean all 39 | 40 | RUN ln -sf /usr/bin/python3 /usr/bin/python 41 | 42 | ENV LANG=en_US.utf8 43 | 44 | # create helixbot user and give rights to sudo without password 45 | RUN /usr/sbin/adduser --uid 1000 --shell /bin/bash --gid adm helixbot \ 46 | && chmod 755 /root \ 47 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 48 | 49 | USER helixbot 50 | WORKDIR /home/helixbot 51 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 52 | 53 | RUN python -m venv $VIRTUAL_ENV && \ 54 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 55 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 56 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 57 | rm ./helix_scripts-*-py3-none-any.whl 58 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 59 | -------------------------------------------------------------------------------- /src/debian/11/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/debian:bullseye 2 | 3 | # Dependencies for generic .NET Core builds and the base toolchain we need to 4 | # build anything (clang, cmake, make and the like) 5 | RUN apt-get update \ 6 | && apt-get upgrade -y \ 7 | && apt-get install -y \ 8 | apt-transport-https \ 9 | curl \ 10 | software-properties-common \ 11 | && curl -sL https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \ 12 | && dpkg -i packages-microsoft-prod.deb \ 13 | && rm packages-microsoft-prod.deb \ 14 | && apt-get update \ 15 | && apt-get install -y \ 16 | autoconf \ 17 | automake \ 18 | azure-cli \ 19 | build-essential \ 20 | clang \ 21 | cmake \ 22 | elfutils \ 23 | file \ 24 | g++ \ 25 | gettext \ 26 | gdb \ 27 | git \ 28 | gnupg \ 29 | jq \ 30 | libcurl4-openssl-dev \ 31 | libicu-dev \ 32 | libkrb5-dev \ 33 | liblldb-dev \ 34 | liblttng-ust-dev \ 35 | libnuma-dev \ 36 | libssl-dev \ 37 | libssl1.1 \ 38 | libtool \ 39 | libunwind8-dev \ 40 | lldb \ 41 | llvm \ 42 | locales \ 43 | make \ 44 | pigz \ 45 | powershell \ 46 | python-lldb \ 47 | sudo \ 48 | tar \ 49 | uuid-dev \ 50 | zip \ 51 | zlib1g-dev \ 52 | && rm -rf /var/lib/apt/lists/* 53 | 54 | # .NET SDK MSBuild requires US.UTF-8 locale to execute tasks 55 | # These commands are from https://askubuntu.com/a/1027038 56 | RUN echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections \ 57 | && echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections \ 58 | && rm "/etc/locale.gen" \ 59 | && dpkg-reconfigure --frontend noninteractive locales 60 | -------------------------------------------------------------------------------- /src/debian/11/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/debian:bullseye 2 | 3 | # Install Helix Dependencies 4 | 5 | RUN apt-get update \ 6 | && apt-get upgrade -y \ 7 | && apt-get install -y \ 8 | apt-transport-https \ 9 | curl \ 10 | software-properties-common \ 11 | && curl -sL https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \ 12 | && dpkg -i packages-microsoft-prod.deb \ 13 | && rm packages-microsoft-prod.deb \ 14 | && apt-get update \ 15 | && apt-get install -y \ 16 | autoconf \ 17 | automake \ 18 | at \ 19 | build-essential \ 20 | gcc \ 21 | gdb \ 22 | git \ 23 | iputils-ping \ 24 | libcurl4 \ 25 | libffi-dev \ 26 | libicu-dev \ 27 | libmsquic \ 28 | libssl-dev \ 29 | libtool \ 30 | libunwind8 \ 31 | llvm \ 32 | locales \ 33 | locales-all \ 34 | python3-dev \ 35 | python3-pip \ 36 | python3-venv \ 37 | sudo \ 38 | tzdata \ 39 | unzip \ 40 | && rm -rf /var/lib/apt/lists/* \ 41 | && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 42 | 43 | ENV LANG=en_US.utf8 44 | 45 | RUN ln -sf /usr/bin/python3 /usr/bin/python 46 | 47 | # Create helixbot user and give rights to sudo without password 48 | RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot \ 49 | && chmod 755 /root \ 50 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 51 | 52 | USER helixbot 53 | WORKDIR /home/helixbot 54 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 55 | 56 | RUN python -m venv $VIRTUAL_ENV && \ 57 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 58 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 59 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ 60 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 61 | rm ./helix_scripts-*-py3-none-any.whl 62 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 63 | -------------------------------------------------------------------------------- /src/debian/11/helix/arm64v8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/debian:bullseye 2 | 3 | # Install Helix Dependencies 4 | 5 | RUN apt-get update \ 6 | && apt-get upgrade -y \ 7 | && apt-get install -y \ 8 | apt-transport-https \ 9 | curl \ 10 | software-properties-common \ 11 | && curl -sL https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \ 12 | && dpkg -i packages-microsoft-prod.deb \ 13 | && rm packages-microsoft-prod.deb \ 14 | && apt-get update \ 15 | && apt-get install -y \ 16 | autoconf \ 17 | automake \ 18 | at \ 19 | build-essential \ 20 | cmake \ 21 | gcc \ 22 | gdb \ 23 | git \ 24 | iputils-ping \ 25 | libcurl4 \ 26 | libffi-dev \ 27 | libicu-dev \ 28 | libmsquic \ 29 | libssl-dev \ 30 | libtool \ 31 | libunwind8 \ 32 | llvm \ 33 | locales \ 34 | locales-all \ 35 | python3-dev \ 36 | python3-pip \ 37 | python3-venv \ 38 | sudo \ 39 | tzdata \ 40 | unzip \ 41 | && rm -rf /var/lib/apt/lists/* \ 42 | && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 43 | 44 | ENV LANG=en_US.utf8 45 | 46 | RUN ln -sf /usr/bin/python3 /usr/bin/python 47 | 48 | # Create helixbot user and give rights to sudo without password 49 | RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot \ 50 | && chmod 755 /root \ 51 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 52 | 53 | USER helixbot 54 | WORKDIR /home/helixbot 55 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 56 | 57 | RUN python -m venv $VIRTUAL_ENV && \ 58 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 59 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 60 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip && \ 61 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 62 | rm ./helix_scripts-*-py3-none-any.whl 63 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 64 | -------------------------------------------------------------------------------- /src/debian/12/gcc15/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/gcc:15-bookworm 2 | 3 | # Dependencies for dotnet/runtime native components. 4 | RUN apt-get update \ 5 | && apt-get upgrade -y \ 6 | && apt-get install -y \ 7 | apt-transport-https \ 8 | curl \ 9 | software-properties-common \ 10 | && curl -sL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \ 11 | && dpkg -i packages-microsoft-prod.deb \ 12 | && rm packages-microsoft-prod.deb \ 13 | && apt-get update \ 14 | && apt-get install -y \ 15 | azure-cli \ 16 | cmake \ 17 | gdb \ 18 | git \ 19 | iputils-ping \ 20 | libicu-dev \ 21 | libkrb5-dev \ 22 | liblttng-ust-dev \ 23 | libssl-dev \ 24 | liblldb-dev \ 25 | lttng-tools \ 26 | locales \ 27 | locales-all \ 28 | pigz \ 29 | powershell \ 30 | python3-dev \ 31 | python3-pip \ 32 | sudo \ 33 | tzdata \ 34 | && rm -rf /var/lib/apt/lists/* \ 35 | && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 36 | 37 | ENV LANG=en_US.utf8 38 | 39 | # These symlinks are required because this docker has gcc-12 suffixed with version and gcc-15 unsuffixed in PATH. 40 | # In the runtime repo, we (by design) give precedence to suffixed compilers before selecting unsuffixed one in PATH. 41 | RUN ln -s $(command -v gcc) /usr/bin/gcc-15 \ 42 | && ln -s $(command -v g++) /usr/bin/g++-15 43 | -------------------------------------------------------------------------------- /src/debian/12/helix/arm64v8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/debian:bookworm AS venv 2 | 3 | RUN apt-get update \ 4 | && apt-get upgrade -y \ 5 | && apt-get install -y \ 6 | coreutils \ 7 | python3-dev \ 8 | python3-pip \ 9 | python3-venv \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | RUN python3 -m venv /venv \ 13 | && . /venv/bin/activate \ 14 | && pip install --upgrade pip setuptools \ 15 | && pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ 16 | && pip install ./helix_scripts-*-py3-none-any.whl \ 17 | && rm ./helix_scripts-*-py3-none-any.whl 18 | 19 | FROM library/debian:bookworm 20 | 21 | # Install Helix Dependencies 22 | RUN apt-get update \ 23 | && apt-get upgrade -y \ 24 | && apt-get install -y \ 25 | apt-transport-https \ 26 | curl \ 27 | software-properties-common \ 28 | && curl -sL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \ 29 | && dpkg -i packages-microsoft-prod.deb \ 30 | && rm packages-microsoft-prod.deb \ 31 | && apt-get update \ 32 | && apt-get install -y \ 33 | autoconf \ 34 | automake \ 35 | at \ 36 | build-essential \ 37 | gcc \ 38 | gdb \ 39 | git \ 40 | iputils-ping \ 41 | libcurl4 \ 42 | libffi-dev \ 43 | libicu-dev \ 44 | libmsquic \ 45 | libssl-dev \ 46 | libtool \ 47 | libunwind8 \ 48 | llvm \ 49 | locales \ 50 | locales-all \ 51 | python3-dev \ 52 | python3-pip \ 53 | python3-venv \ 54 | sudo \ 55 | tzdata \ 56 | unzip \ 57 | && rm -rf /var/lib/apt/lists/* \ 58 | && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 59 | 60 | ENV LANG=en_US.utf8 61 | 62 | # Create helixbot user and give rights to sudo without password 63 | RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot \ 64 | && chmod 755 /root \ 65 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 66 | 67 | USER helixbot 68 | 69 | # Install Helix Dependencies 70 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 71 | RUN python3 -m venv $VIRTUAL_ENV \ 72 | && ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools 73 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 74 | COPY --from=venv --chown=helixbot /venv $VIRTUAL_ENV 75 | -------------------------------------------------------------------------------- /src/fedora/40/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/fedora:40 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf install --setopt tsflags=nodocs -y \ 5 | dnf-plugins-core \ 6 | && dnf config-manager --add-repo=https://packages.microsoft.com/fedora/40/prod/config.repo \ 7 | && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ 8 | # Base toolchain we need to build anything (clang, cmake, make and the like) 9 | clang \ 10 | cmake \ 11 | findutils \ 12 | gdb \ 13 | glibc-langpack-en \ 14 | lldb-devel \ 15 | llvm-devel \ 16 | make \ 17 | pigz \ 18 | python \ 19 | which \ 20 | # Tools used by build automation 21 | azure-cli \ 22 | git \ 23 | jq \ 24 | tar \ 25 | procps \ 26 | zip \ 27 | # Dependencies of CoreCLR, Mono and CoreFX 28 | autoconf \ 29 | automake \ 30 | brotli-devel \ 31 | glibc-locale-source \ 32 | iputils \ 33 | jq \ 34 | krb5-devel \ 35 | libcurl-devel \ 36 | libicu-devel \ 37 | libomp-devel \ 38 | libtool \ 39 | libunwind-devel \ 40 | libuuid-devel \ 41 | lttng-ust-devel \ 42 | openssl-devel \ 43 | uuid-devel \ 44 | zlib-devel \ 45 | # Dependencies for VMR/source-build tests 46 | elfutils \ 47 | file \ 48 | # Dependencies to support globalization 49 | icu \ 50 | && dnf clean all 51 | 52 | # Install the latest non-preview powershell release. 53 | RUN LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \ 54 | && curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-x64.tar.gz -o /tmp/powershell.tar.gz \ 55 | && mkdir -p /opt/microsoft/powershell \ 56 | && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \ 57 | && chmod +x /opt/microsoft/powershell/pwsh \ 58 | && ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \ 59 | && rm -f /tmp/powershell.tar.gz 60 | -------------------------------------------------------------------------------- /src/fedora/41/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM library/fedora:41 2 | 3 | RUN dnf upgrade --refresh -y \ 4 | && dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/fedora/41/prod/config.repo \ 5 | && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ 6 | # Base toolchain we need to build anything (clang, cmake, make and the like) 7 | clang \ 8 | cmake \ 9 | dnf-plugins-core \ 10 | findutils \ 11 | gdb \ 12 | glibc-langpack-en \ 13 | lldb-devel \ 14 | llvm-devel \ 15 | make \ 16 | pigz \ 17 | python \ 18 | which \ 19 | # Tools used by build automation 20 | azure-cli \ 21 | git \ 22 | jq \ 23 | tar \ 24 | procps \ 25 | zip \ 26 | # Dependencies of CoreCLR, Mono and CoreFX 27 | autoconf \ 28 | automake \ 29 | brotli-devel \ 30 | cpio \ 31 | glibc-locale-source \ 32 | iputils \ 33 | jq \ 34 | krb5-devel \ 35 | libcurl-devel \ 36 | libicu-devel \ 37 | libomp-devel \ 38 | libtool \ 39 | libunwind-devel \ 40 | libuuid-devel \ 41 | lttng-ust-devel \ 42 | openssl-devel \ 43 | rapidjson-devel \ 44 | uuid-devel \ 45 | zlib-devel \ 46 | # Dependencies for VMR/source-build tests 47 | iproute \ 48 | elfutils \ 49 | file \ 50 | # Dependencies to support globalization 51 | icu \ 52 | && dnf clean all 53 | 54 | # Install the latest non-preview powershell release. 55 | RUN LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \ 56 | && curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-x64.tar.gz -o /tmp/powershell.tar.gz \ 57 | && mkdir -p /opt/microsoft/powershell \ 58 | && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell \ 59 | && chmod +x /opt/microsoft/powershell/pwsh \ 60 | && ln -s /opt/microsoft/powershell/pwsh /usr/bin/pwsh \ 61 | && rm -f /tmp/powershell.tar.gz 62 | -------------------------------------------------------------------------------- /src/fedora/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "repos": [ 3 | { 4 | "name": "dotnet-buildtools/prereqs", 5 | "images": [ 6 | { 7 | "platforms": [ 8 | { 9 | "dockerfile": "src/fedora/40/amd64", 10 | "os": "linux", 11 | "osVersion": "fedora40", 12 | "tags": { 13 | "fedora-40": {}, 14 | "fedora-40-amd64": {} 15 | } 16 | } 17 | ] 18 | }, 19 | { 20 | "platforms": [ 21 | { 22 | "dockerfile": "src/fedora/41/amd64", 23 | "os": "linux", 24 | "osVersion": "fedora41", 25 | "tags": { 26 | "fedora-41": {}, 27 | "fedora-41-amd64": {} 28 | } 29 | } 30 | ] 31 | }, 32 | { 33 | "platforms": [ 34 | { 35 | "dockerfile": "src/fedora/41/helix/amd64", 36 | "os": "linux", 37 | "osVersion": "fedora41", 38 | "tags": { 39 | "fedora-41-helix": {}, 40 | "fedora-41-helix-amd64": {} 41 | } 42 | } 43 | ] 44 | }, 45 | { 46 | "platforms": [ 47 | { 48 | "dockerfile": "src/fedora/42/helix/amd64", 49 | "os": "linux", 50 | "osVersion": "fedora42", 51 | "tags": { 52 | "fedora-42-helix-amd64": {} 53 | } 54 | } 55 | ] 56 | } 57 | ] 58 | } 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /src/nanoserver/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "repos": [ 3 | { 4 | "name": "dotnet-buildtools/prereqs", 5 | "images": [ 6 | { 7 | "platforms": [ 8 | { 9 | "dockerfile": "src/nanoserver/1809/helix/amd64", 10 | "os": "windows", 11 | "osVersion": "nanoserver-1809", 12 | "tags": { 13 | "nanoserver-1809-helix-amd64": {} 14 | } 15 | } 16 | ] 17 | } 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/opensuse/15.6/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM opensuse/leap:15.6 2 | 3 | # Install Helix Dependencies 4 | RUN zypper ref \ 5 | && zypper update -y \ 6 | && zypper install -y -t pattern \ 7 | devel_C_C++ \ 8 | && zypper install -y \ 9 | autoconf \ 10 | automake \ 11 | clang \ 12 | cmake \ 13 | gcc-locale \ 14 | gdb \ 15 | git \ 16 | glibc-i18ndata \ 17 | gssntlmssp \ 18 | iputils \ 19 | krb5-devel \ 20 | lato-fonts \ 21 | libffi-devel \ 22 | libicu-devel \ 23 | libopenssl-devel \ 24 | libtool \ 25 | libunwind \ 26 | lldb-devel \ 27 | llvm \ 28 | lttng-ust-devel \ 29 | python312-devel \ 30 | python312-pip \ 31 | sudo \ 32 | unzip \ 33 | wget \ 34 | && zypper clean -a 35 | 36 | ENV LANG=en_US.utf8 37 | 38 | # Install MsQuic from official GitHub releases 39 | RUN wget https://packages.microsoft.com/keys/microsoft.asc \ 40 | && rpm --import microsoft.asc \ 41 | && rm microsoft.asc \ 42 | && zypper addrepo https://packages.microsoft.com/opensuse/15/prod/ "MS Packages" \ 43 | && zypper install -y \ 44 | libmsquic \ 45 | && zypper clean -a 46 | 47 | RUN ln -sf /usr/bin/python3.12 /usr/bin/python 48 | 49 | # create helixbot user and give rights to sudo without password 50 | RUN /usr/sbin/useradd --uid 1000 --shell /bin/bash --system --create-home --groups trusted helixbot \ 51 | && chmod 755 /root \ 52 | && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 53 | 54 | USER helixbot 55 | WORKDIR /home/helixbot 56 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 57 | 58 | RUN python -m venv $VIRTUAL_ENV && \ 59 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 60 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 61 | rm ./helix_scripts-*-py3-none-any.whl 62 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 63 | -------------------------------------------------------------------------------- /src/opensuse/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "repos": [ 3 | { 4 | "name": "dotnet-buildtools/prereqs", 5 | "images": [ 6 | { 7 | "platforms": [ 8 | { 9 | "architecture": "amd64", 10 | "dockerfile": "src/opensuse/15.6/helix/amd64", 11 | "os": "linux", 12 | "osVersion": "leap15.6", 13 | "tags": { 14 | "opensuse-15.6-helix-amd64": {} 15 | } 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/coredeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/powershell:ubuntu-22.04 2 | 3 | # Install tools used by the AzDO build automation. 4 | RUN apt-get update \ 5 | && apt-get upgrade -y \ 6 | && apt-get install -y \ 7 | git \ 8 | nodejs \ 9 | npm \ 10 | tar \ 11 | zip \ 12 | && curl -sL https://aka.ms/InstallAzureCLIDeb | bash \ 13 | && rm -rf /var/lib/apt/lists/* 14 | 15 | # Runtime dependencies 16 | RUN apt-get update \ 17 | && apt-get upgrade -y \ 18 | && apt-get install -y \ 19 | autoconf \ 20 | automake \ 21 | build-essential \ 22 | gettext \ 23 | jq \ 24 | libcurl4-openssl-dev \ 25 | libicu-dev \ 26 | libkrb5-dev \ 27 | liblttng-ust-dev \ 28 | libnuma-dev \ 29 | libssl-dev \ 30 | libtool \ 31 | libunwind8 \ 32 | libunwind8-dev \ 33 | python3 \ 34 | python3-pip \ 35 | uuid-dev \ 36 | && rm -rf /var/lib/apt/lists/* 37 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/cross/armel-tizen/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ROOTFS_DIR=/crossrootfs/armel 2 | 3 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-crossdeps AS builder 4 | ARG ROOTFS_DIR 5 | 6 | # Obtain arcade scripts used to build rootfs 7 | RUN git config --global user.email builder@dotnet-buildtools-prereqs-docker && \ 8 | git clone --depth 1 --single-branch https://github.com/dotnet/arcade /scripts 9 | 10 | RUN /scripts/eng/common/cross/tizen-build-rootfs.sh armel 11 | 12 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-crossdeps 13 | ARG ROOTFS_DIR 14 | 15 | # Install binutils-arm-linux-gnueabi 16 | RUN apt-get update \ 17 | && apt-get upgrade -y \ 18 | && apt-get install -y \ 19 | binutils-arm-linux-gnueabi \ 20 | && rm -rf /var/lib/apt/lists/* 21 | 22 | COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR 23 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/crossdeps/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-coredeps 2 | 3 | # Install the base toolchain we need to build anything (clang, cmake, make and the like). 4 | RUN apt-get update \ 5 | && apt-get upgrade -y \ 6 | && apt-get install -y \ 7 | apt-transport-https \ 8 | ca-certificates \ 9 | gnupg \ 10 | software-properties-common \ 11 | wget \ 12 | && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - \ 13 | && apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' \ 14 | && apt-get update \ 15 | && apt-get install -y \ 16 | binfmt-support \ 17 | binutils-arm-linux-gnueabihf \ 18 | bison \ 19 | bisonc++ \ 20 | build-essential \ 21 | cmake \ 22 | cpio \ 23 | debian-archive-keyring \ 24 | debootstrap \ 25 | flex \ 26 | gdb \ 27 | make \ 28 | nasm \ 29 | pigz \ 30 | qemu \ 31 | qemu-user-static \ 32 | rpm2cpio \ 33 | texinfo \ 34 | libbz2-dev \ 35 | libz-dev \ 36 | liblzma-dev \ 37 | libarchive-dev \ 38 | libbsd-dev \ 39 | libmpc-dev \ 40 | libxml2-utils \ 41 | libzstd-dev \ 42 | && rm -rf /var/lib/apt/lists/* 43 | 44 | # install llvm-toolchain using official script 45 | RUN wget -O- https://apt.llvm.org/llvm.sh | bash -s -- 18 \ 46 | && apt-get install -y \ 47 | clang-tools-18 \ 48 | liblldb-18-dev \ 49 | llvm-18 \ 50 | && rm -rf /var/lib/apt/lists/* 51 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/debpkg/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04 2 | 3 | # Install the deb packaging toolchain we need to build debs 4 | RUN apt-get update \ 5 | && apt-get -y install \ 6 | build-essential \ 7 | debhelper \ 8 | devscripts \ 9 | liblldb-14 \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | # Install powershell. This is in the debpkg/amd64 docker file as it may not be required in the arm64 13 | # images, and is not actually supported over there. 14 | RUN apt-get update && \ 15 | apt-get install -y \ 16 | apt-transport-https \ 17 | software-properties-common \ 18 | curl && \ 19 | curl -sL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb && \ 20 | dpkg -i packages-microsoft-prod.deb && \ 21 | rm packages-microsoft-prod.deb && \ 22 | apt-get update && \ 23 | apt-get install -y powershell && \ 24 | rm -rf /var/lib/apt/lists/* 25 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/helix/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu.azurecr.io/ubuntu:22.04 2 | 3 | # Install Helix Dependencies 4 | ENV DEBIAN_FRONTEND=noninteractive 5 | 6 | RUN apt-get update && \ 7 | apt-get install -qq -y \ 8 | autoconf \ 9 | automake \ 10 | build-essential \ 11 | cmake \ 12 | clang \ 13 | curl \ 14 | gcc \ 15 | gdb \ 16 | git \ 17 | gss-ntlmssp \ 18 | iputils-ping \ 19 | libcurl4 \ 20 | libffi-dev \ 21 | libicu-dev \ 22 | libssl-dev \ 23 | libtool \ 24 | libunwind8 \ 25 | libunwind-dev \ 26 | lldb-12 \ 27 | llvm \ 28 | locales \ 29 | locales-all \ 30 | python3-dev \ 31 | python3-pip \ 32 | python3-venv \ 33 | software-properties-common \ 34 | sudo \ 35 | tzdata \ 36 | unzip \ 37 | && rm -rf /var/lib/apt/lists/* \ 38 | \ 39 | && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 40 | 41 | ENV LANG=en_US.utf8 42 | 43 | RUN ln -sf /usr/bin/python3 /usr/bin/python 44 | 45 | # Add MsQuic 46 | RUN curl -LO https://packages.microsoft.com/keys/microsoft.asc && \ 47 | apt-key add microsoft.asc && \ 48 | rm microsoft.asc && \ 49 | apt-add-repository https://packages.microsoft.com/ubuntu/22.04/prod && \ 50 | apt-get update && \ 51 | apt-get install -y libmsquic && \ 52 | rm -rf /var/lib/apt/lists/* 53 | 54 | # create helixbot user and give rights to sudo without password 55 | RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot && \ 56 | chmod 755 /root && \ 57 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 58 | 59 | USER helixbot 60 | WORKDIR /home/helixbot 61 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 62 | 63 | RUN python -m venv /home/helixbot/.vsts-env && \ 64 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 65 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 66 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 67 | rm ./helix_scripts-*-py3-none-any.whl 68 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 69 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/helix/sqlserver/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64 2 | 3 | USER root 4 | 5 | # Install SQL Server and FTS. 6 | RUN apt-get update \ 7 | && apt-get install -qq -y \ 8 | software-properties-common \ 9 | && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ 10 | && curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server-2022.list \ 11 | && apt-get update \ 12 | && apt-get install -y \ 13 | mssql-server \ 14 | mssql-server-fts \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | # Create new user group and add helixbot to it. This user group will have permission to folders which are needed for SQL Server. 18 | RUN groupadd -g 1000 sqlserver_users \ 19 | && usermod -a -G sqlserver_users helixbot \ 20 | # Create required directory to avoid giving permission to /. 21 | && mkdir /var/opt/mssql/.system/system \ 22 | && chgrp -R sqlserver_users /var/opt/mssql \ 23 | && chmod -R 770 /var/opt/mssql 24 | 25 | CMD ["/opt/mssql/bin/sqlservr", "--accept-eula"] 26 | 27 | USER helixbot -------------------------------------------------------------------------------- /src/ubuntu/22.04/helix/webassembly/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64 2 | 3 | USER root 4 | 5 | # Dependencies for WebAssembly build 6 | RUN apt-get update \ 7 | && apt-get install -y \ 8 | libasound2 \ 9 | libatk-bridge2.0-0 \ 10 | libatk1.0-0 \ 11 | libcairo2 \ 12 | libcups2 \ 13 | libdbus-glib-1-2 \ 14 | libdrm2 \ 15 | libgbm-dev \ 16 | libgtk-3-0 \ 17 | libnss3 \ 18 | libpango-1.0-0 \ 19 | libssl-dev \ 20 | libtinfo-dev \ 21 | libxcomposite-dev \ 22 | libxdamage1 \ 23 | libxkbcommon-x11-0 \ 24 | libxrandr2 \ 25 | libx11-xcb-dev \ 26 | locales \ 27 | unzip \ 28 | wget \ 29 | && rm -rf /var/lib/apt/lists/* 30 | 31 | ENV CMAKE_VERSION=3.17 32 | RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.0-Linux-x86_64.tar.gz \ 33 | && tar -xf cmake-${CMAKE_VERSION}.0-Linux-x86_64.tar.gz --strip 1 -C /usr/local \ 34 | && rm cmake-${CMAKE_VERSION}.0-Linux-x86_64.tar.gz 35 | 36 | # WebAssembly build needs working UTF-8 locale 37 | RUN locale-gen en_US.UTF-8 38 | 39 | # install node, which is required for newer npm, jsvu and v8 40 | COPY ./setup-node-23.x.sh /tmp 41 | RUN /tmp/setup-node-23.x.sh && apt-get -y install nodejs 42 | 43 | RUN npm install -g npm 44 | 45 | # Install latest V8 engine 46 | ENV PATH="/home/helixbot/.jsvu/bin:${PATH}" 47 | RUN npm install jsvu -g \ 48 | && su helixbot -c "jsvu --os=linux64 --engines=v8" \ 49 | && v8 -e "console.log(version());quit();" \ 50 | && npm uninstall jsvu -g 51 | 52 | USER helixbot 53 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/mlnet/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04 2 | 3 | # Install openmp support 4 | RUN apt-get update \ 5 | && apt-get install -y \ 6 | libomp5 \ 7 | libomp-dev \ 8 | && rm -rf /var/lib/apt/lists/* 9 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/mlnet/helix/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-mlnet 2 | 3 | # Install Helix Dependencies 4 | RUN apt-get update \ 5 | && apt-get install -y \ 6 | python3-pip \ 7 | python3-venv \ 8 | && rm -rf /var/lib/apt/lists/* 9 | 10 | RUN ln -sf /usr/bin/python3 /usr/bin/python 11 | 12 | # create helixbot user and give rights to sudo without password 13 | RUN /usr/sbin/adduser --disabled-password --gecos '' --uid 1000 --shell /bin/bash --ingroup adm helixbot && \ 14 | chmod 755 /root && \ 15 | echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/helixbot 16 | 17 | USER helixbot 18 | WORKDIR /home/helixbot 19 | ENV VIRTUAL_ENV=/home/helixbot/.vsts-env 20 | 21 | RUN python -m venv $VIRTUAL_ENV && \ 22 | ${VIRTUAL_ENV}/bin/pip install --upgrade pip setuptools && \ 23 | ${VIRTUAL_ENV}/bin/pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ 24 | ${VIRTUAL_ENV}/bin/pip install ./helix_scripts-*-py3-none-any.whl && \ 25 | rm ./helix_scripts-*-py3-none-any.whl 26 | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" 27 | -------------------------------------------------------------------------------- /src/ubuntu/22.04/opt/arm64v8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu.azurecr.io/ubuntu:22.04 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y sudo \ 5 | && rm -rf /var/lib/apt/lists/* 6 | -------------------------------------------------------------------------------- /src/ubuntu/24.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu.azurecr.io/ubuntu:24.04 2 | 3 | # Install the base toolchain we need to build anything (clang, cmake, make and the like) 4 | # this does not include libraries that we need to compile different projects, we'd like 5 | # them in a different layer. 6 | RUN apt-get update \ 7 | && apt-get install -y \ 8 | clang-18 \ 9 | cmake \ 10 | gdb \ 11 | liblldb-18-dev \ 12 | lldb-18 \ 13 | llvm-18 \ 14 | locales \ 15 | make \ 16 | pigz \ 17 | sudo \ 18 | && rm -rf /var/lib/apt/lists/* 19 | 20 | # Install tools used by the VSO build automation. 21 | RUN apt-get update \ 22 | && apt-get install -y \ 23 | curl \ 24 | git \ 25 | iproute2 \ 26 | npm \ 27 | zip \ 28 | && rm -rf /var/lib/apt/lists/* 29 | 30 | # .NET SDK MSBuild requires US.UTF-8 locale to execute tasks 31 | RUN locale-gen en_US.UTF-8 32 | 33 | # Runtime dependencies 34 | RUN apt-get update \ 35 | && apt-get install -y \ 36 | autoconf \ 37 | automake \ 38 | build-essential \ 39 | cpio \ 40 | curl \ 41 | gettext \ 42 | jq \ 43 | libbrotli-dev \ 44 | libicu-dev \ 45 | libkrb5-dev \ 46 | liblttng-ust-dev \ 47 | libnuma-dev \ 48 | libssl-dev \ 49 | libtool \ 50 | libunwind8 \ 51 | libunwind8-dev \ 52 | uuid-dev \ 53 | zlib1g-dev \ 54 | && rm -rf /var/lib/apt/lists/* 55 | 56 | # Dependencies for VMR/source-build tests 57 | RUN apt-get update \ 58 | && apt-get install -y \ 59 | elfutils \ 60 | file \ 61 | && rm -rf /var/lib/apt/lists/* 62 | 63 | # Remove older version of node & install node 20 64 | RUN rm -f /etc/apt/sources.list.d/nodesource.list && \ 65 | apt-get --fix-broken install && \ 66 | apt-get update && \ 67 | apt-get remove nodejs -y && \ 68 | apt-get remove nodejs-doc -y && \ 69 | apt-get remove libnode-dev -y 70 | 71 | RUN cd ~ && \ 72 | curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh && \ 73 | bash nodesource_setup.sh && \ 74 | apt-get install nodejs -y && \ 75 | rm -rf /var/lib/apt/lists/* && \ 76 | rm -f nodesource_setup.sh 77 | 78 | ENV NO_UPDATE_NOTIFIER=true 79 | -------------------------------------------------------------------------------- /src/ubuntu/24.04/helix/webassembly/amd64/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64 2 | 3 | USER root 4 | 5 | # Dependencies for WebAssembly build 6 | RUN apt-get update \ 7 | && apt-get install -y \ 8 | libasound2t64 \ 9 | libatk-bridge2.0-0 \ 10 | libatk1.0-0 \ 11 | libcairo2 \ 12 | libcups2 \ 13 | libdbus-glib-1-2 \ 14 | libdrm2 \ 15 | libgbm-dev \ 16 | libgtk-3-0 \ 17 | libnss3 \ 18 | libpango-1.0-0 \ 19 | libssl-dev \ 20 | libtinfo-dev \ 21 | libxcomposite-dev \ 22 | libxdamage1 \ 23 | libxkbcommon-x11-0 \ 24 | libxrandr2 \ 25 | libx11-xcb-dev \ 26 | locales \ 27 | unzip \ 28 | && rm -rf /var/lib/apt/lists/* 29 | 30 | ENV CMAKE_SHORTVERSION=3.31 31 | ENV CMAKE_VERSION=3.31.7 32 | RUN curl -O https://cmake.org/files/v${CMAKE_SHORTVERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz \ 33 | && tar -xf cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz --strip 1 -C /usr/local \ 34 | && rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz 35 | 36 | # WebAssembly build needs working UTF-8 locale 37 | RUN locale-gen en_US.UTF-8 38 | 39 | # install node, which is required for newer npm, jsvu and v8 40 | COPY ./setup-node-23.x.sh /tmp 41 | RUN chmod +x /tmp/setup-node-23.x.sh \ 42 | && /tmp/setup-node-23.x.sh \ 43 | && rm /tmp/setup-node-23.x.sh \ 44 | && apt-get update \ 45 | && apt-get install -y nodejs \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | RUN npm install -g npm 49 | 50 | # Install latest V8 engine 51 | ENV PATH="/home/helixbot/.jsvu/bin:${PATH}" 52 | RUN npm install jsvu -g \ 53 | && su helixbot -c "jsvu --os=linux64 --engines=v8" \ 54 | && v8 -e "console.log(version());quit();" \ 55 | && npm uninstall jsvu -g 56 | 57 | USER helixbot 58 | -------------------------------------------------------------------------------- /src/ubuntu/build-scripts/install-cross-build-prereqs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Stop script on NZEC 4 | set -e 5 | # Stop script if unbound variable found (use ${var:-} if intentional) 6 | set -u 7 | 8 | # we need to make sure that we install binfmt >= 2.2.0 and qemu-user-static >= 1.4.2, 9 | # which are available in Ubuntu 20.04+ repositories 10 | . /etc/os-release 11 | if [ "$(echo "$VERSION_ID" | tr -d .)" -lt 2004 ]; then 12 | sed "s/$UBUNTU_CODENAME/focal/g" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/focal.list 13 | fi 14 | 15 | function installPkgs { 16 | sudo apt-get update 17 | # see (see https://github.com/dotnet/dotnet-buildtools-prereqs-docker/issues/120) 18 | sudo apt-get install -y \ 19 | binfmt-support \ 20 | qemu \ 21 | qemu-user-static 22 | } 23 | 24 | # Retry apt-get update due to https://github.com/dotnet/dotnet-buildtools-prereqs-docker/issues/758 25 | retryCount=0 26 | waitSecs=60 27 | until installPkgs; do 28 | retryCount=$((retryCount+1)) 29 | if [ $retryCount -lt 10 ]; then 30 | echo "Failed to update apt-get, retrying in $waitSecs seconds..." 31 | sleep $waitSecs 32 | else 33 | echo "Failed to update apt-get, aborting." 34 | exit 1 35 | fi 36 | done 37 | -------------------------------------------------------------------------------- /src/windowsservercore/ltsc2022/helix/webassembly-net8/amd64/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-buildtools-prereqs-docker/71319b9cca8805dc2296c5ce47afe09361679a89/src/windowsservercore/ltsc2022/helix/webassembly-net8/amd64/arial.ttf -------------------------------------------------------------------------------- /src/windowsservercore/ltsc2022/helix/webassembly/amd64/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-buildtools-prereqs-docker/71319b9cca8805dc2296c5ce47afe09361679a89/src/windowsservercore/ltsc2022/helix/webassembly/amd64/arial.ttf -------------------------------------------------------------------------------- /src/windowsservercore/ltsc2025/helix/webassembly-net8/amd64/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-buildtools-prereqs-docker/71319b9cca8805dc2296c5ce47afe09361679a89/src/windowsservercore/ltsc2025/helix/webassembly-net8/amd64/arial.ttf -------------------------------------------------------------------------------- /src/windowsservercore/ltsc2025/helix/webassembly/amd64/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/dotnet-buildtools-prereqs-docker/71319b9cca8805dc2296c5ce47afe09361679a89/src/windowsservercore/ltsc2025/helix/webassembly/amd64/arial.ttf -------------------------------------------------------------------------------- /tests/Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests/Config.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace Microsoft.DotNet.BuildToolsPrereqs.Docker.Tests; 8 | 9 | internal static class Config 10 | { 11 | const string ConfigSwitchPrefix = "Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests."; 12 | 13 | public static string RepoDirectory => (string)AppContext.GetData(ConfigSwitchPrefix + nameof(RepoDirectory))! ?? 14 | throw new InvalidOperationException("RepoDirectory must be specified"); 15 | 16 | public static string SrcDirectory => (string)AppContext.GetData(ConfigSwitchPrefix + nameof(SrcDirectory))! ?? 17 | throw new InvalidOperationException("SrcDirectory must be specified"); 18 | } 19 | -------------------------------------------------------------------------------- /tests/Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests/Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | false 6 | Exe 7 | net9.0 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | $(RepoDirectory) 29 | 30 | 31 | $(SrcDirectory) 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tests/Microsoft.DotNet.BuildTools.Prereqs.Docker.Tests/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", 3 | "diagnosticMessages": true, 4 | "showLiveOutput": true 5 | } 6 | --------------------------------------------------------------------------------