-
Notifications
You must be signed in to change notification settings - Fork 60
[main] Update Image Builder tag reference #1710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lbussell
merged 5 commits into
dotnet:main
from
dotnet-docker-bot:docker-tools-main-image-builder-tag
May 29, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7b245f7
Update Image Builder tag reference
dotnet-docker-bot 7b1d3fe
Add service connection argument support to templates
lbussell 77d9170
Add better service connections comment
lbussell 46311e5
Declare ImageBuilder service connections
lbussell 09cbdec
Merge branch 'main' into docker-tools-main-image-builder-tag
lbussell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This stage exists to tell Azure DevOps about all of the service connections | ||
# that will be used in the pipeline. A service connection will not work unless | ||
# it is declared in this stage's parameters, even if your pipeline has already | ||
# been granted access to the service connection. This stage also does not need | ||
# to complete before the service connection is used. | ||
parameters: | ||
- name: pool | ||
type: object | ||
# serviceConnections object shape: | ||
# - name: string | ||
- name: serviceConnections | ||
type: object | ||
default: [] | ||
|
||
stages: | ||
|
||
- stage: SetupServiceConnectionsStage | ||
displayName: Setup service connections | ||
jobs: | ||
|
||
- job: SetupServiceConnectionsJob | ||
displayName: Setup service connections | ||
pool: ${{ parameters.pool }} | ||
steps: | ||
|
||
- ${{ each serviceConnection in parameters.serviceConnections }}: | ||
- task: AzureCLI@2 | ||
displayName: Setup ${{ serviceConnection.name }} | ||
inputs: | ||
azureSubscription: ${{ serviceConnection.name }} | ||
scriptType: pscore | ||
scriptLocation: inlineScript | ||
inlineScript: | | ||
az account show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,26 +24,27 @@ steps: | |
# Setup Image Builder (Optional) | ||
################################################################################ | ||
- ${{ if eq(parameters.setupImageBuilder, 'true') }}: | ||
|
||
- script: $(engCommonPath)/pull-image.sh $(imageNames.imageBuilder) | ||
displayName: Pull Image Builder | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
- script: > | ||
|
||
- script: >- | ||
docker build | ||
-t $(imageNames.imageBuilder.withrepo) | ||
--build-arg IMAGE=$(imageNames.imageBuilder) | ||
-f $(engCommonPath)/Dockerfile.WithRepo . | ||
displayName: Build Image for Image Builder | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
|
||
- task: PowerShell@2 | ||
displayName: Define ImageBuilder Command Variables | ||
condition: and(succeeded(), ${{ parameters.condition }}) | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$tokenHostPath = '$(Agent.TempDirectory)' | ||
$tokenHostFilePath = "${tokenHostPath}/token" | ||
$tokenContainerPath = "/tmp" | ||
$tokenContainerFilePath = "${tokenContainerPath}/token" | ||
$imageBuilderImageName = "$(imageNames.imageBuilder.withrepo)" | ||
Write-Host "##vso[task.setvariable variable=imageBuilderImageName]$imageBuilderImageName" | ||
|
||
$dockerRunBaseCmd = @( | ||
"docker run --rm" | ||
|
@@ -58,10 +59,8 @@ steps: | |
) | ||
|
||
$authedDockerRunArgs = @( | ||
'-e AZURE_TENANT_ID=$env:tenantId' | ||
'-e AZURE_CLIENT_ID=$env:servicePrincipalId' | ||
"-e AZURE_FEDERATED_TOKEN_FILE=$tokenContainerFilePath" | ||
"-v ${tokenHostPath}:${tokenContainerPath}" | ||
'-e SYSTEM_ACCESSTOKEN=$(System.AccessToken)' | ||
'-e SYSTEM_OIDCREQUESTURI=$(System.OidcRequestUri)' | ||
) | ||
|
||
$dockerRunCmd = $dockerRunBaseCmd + $dockerRunArgs | ||
Comment on lines
+62
to
66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think some or all of this step (Define ImageBuilder Command Variables) could now be embedded directly into run-imagebuilder.yml. |
||
|
@@ -72,7 +71,6 @@ steps: | |
|
||
Write-Host "##vso[task.setvariable variable=runImageBuilderCmd]$runImageBuilderCmd" | ||
Write-Host "##vso[task.setvariable variable=runAuthedImageBuilderCmd]$runAuthedImageBuilderCmd" | ||
Write-Host "##vso[task.setvariable variable=tokenHostFilePath]$tokenHostFilePath" | ||
|
||
################################################################################ | ||
# Setup Test Runner (Optional) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.