feat: add container image passthrough - #9588
Draft
Wei Meng (m5i-work) wants to merge 1 commit into
Draft
Conversation
Adds docker.imagePassthrough so service targets can consume a final remote image reference without azd building, pulling, tagging, copying, or publishing it.\n\nFixes Azure#9587
|
Azure Pipelines: 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an explicit core signal for service targets that deploy an already-published container image by reference:
When
docker.imagePassthroughis true, azd treats the service-levelimageas the final remote container artifact and does not:The exact image reference is passed to the service target through remote package and publish artifacts.
Fixes #9587
Motivation
Core Docker framework packaging runs before extension service-target packaging. For a service with a top-level
imageand no local build artifact, core currently treats the image as an external source image and performsdocker pullfollowed bydocker tag.That behavior is correct for existing Container Apps, AKS, and App Service scenarios that copy an external image into a deployment registry, but it prevents targets that delegate image retrieval to the destination platform. One example is a Foundry hosted agent whose private registry authentication is represented by a Foundry project connection rather than local Docker credentials.
The agents extension currently uses
docker.remoteBuild: trueto suppress local Build and Package. That is not the intended meaning ofremoteBuild, which represents an ACR Tasks build.Behavior
Passthrough
Produces a remote container artifact with the same image reference during Package and Publish. Core performs no local or remote image operations.
Validation
The following combinations are rejected:
A publish image override is also rejected because passthrough preserves the configured image reference unchanged.
Backward compatibility
imagePassthroughdefaults to false. Existing behavior remains unchanged when the property is absent:docker.remoteBuildcontinues to mean an ACR Tasks build with the existing local fallback behavior;--from-packageshort-circuits remain unchanged.Implementation
ImagePassthroughtoDockerProjectOptionsimage_passthrough = 11ContainerHelper.PublishTests
Coverage includes:
remoteBuildconflict validationgolangci-lintandcspellwere unavailable locally; CI will run both.