Repository navigation
Add container tunnel base image configuration - #20667
Conversation
Expose the DCP container tunnel base image through AppHost configuration and aspire config, and project CLI settings into both .NET and polyglot AppHost server environments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20667Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20667" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Direct-launch precedence is inverted, and the committed VS Code configuration schema remains stale.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds configurable container-tunnel base images across the CLI, AppHost, and DCP pipeline.
Changes:
- Adds Aspire config, environment-variable, and AppHost argument support.
- Projects configuration into .NET and polyglot AppHosts.
- Passes the configured image to DCP with focused tests.
| File | Description |
|---|---|
tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs |
Verifies DCP tunnel image emission. |
tests/Aspire.Hosting.Tests/Dcp/DcpCliArgsTests.cs |
Tests argument and configuration binding. |
tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs |
Registers the projector in tests. |
tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectTests.cs |
Tests polyglot projection. |
tests/Aspire.Cli.Tests/Projects/DotNetAppHostProjectTests.cs |
Tests .NET projection. |
tests/Aspire.Cli.Tests/Projects/AppHostConfigurationProjectorTests.cs |
Tests projection precedence. |
tests/Aspire.Cli.Tests/Commands/ConfigCommandTests.cs |
Tests configuration persistence and discovery. |
src/Shared/KnownConfigNames.cs |
Defines the environment variable. |
src/Aspire.Hosting/DistributedApplicationBuilder.cs |
Maps the new AppHost argument. |
src/Aspire.Hosting/Dcp/DcpOptions.cs |
Binds the tunnel image option. |
src/Aspire.Hosting/Dcp/ContainerNetworkEndpointProvisioner.cs |
Sends the image to DCP. |
src/Aspire.Cli/Projects/GuestAppHostProject.cs |
Projects configuration into the server session. |
src/Aspire.Cli/Projects/DotNetAppHostProject.cs |
Projects configuration into .NET launches. |
src/Aspire.Cli/Projects/AppHostConfigurationProjector.cs |
Implements reusable projection logic. |
src/Aspire.Cli/Program.cs |
Registers the projector service. |
src/Aspire.Cli/Configuration/AspireConfigFile.cs |
Defines containerTunnel.baseImage. |
Include the container tunnel base image setting in the committed VS Code schema. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Project Aspire config into the final launch environment so launch profile values override it consistently across direct and SDK-based AppHost launches. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: Aspire configuration contractObjective: Verify the new setting can be persisted through Steps:
Evidence:
Scenario 2: .NET AppHost runtime projectionObjective: Verify project-local Aspire configuration reaches the live DCP Steps:
Observations:
Evidence:
Scenario 3: Launch-profile precedenceObjective: Verify a launch-profile Steps:
Observations:
Evidence:
Scenario 4: Polyglot AppHost-server projectionObjective: Verify a TypeScript guest AppHost projects the setting to the .NET AppHost server that owns Hosting and DCP. Steps:
Observations:
Evidence:
Scenario 5: AppHost-relative configuration outside the current directoryObjective: Verify Steps:
Observations:
Evidence:
Scenario 6: Schema regeneration and extension buildObjective: Verify the committed VS Code Aspire configuration schema is generated from the CLI model and the extension still builds. Steps:
Evidence:
Source Validation
Exploratory Invalid-Image CheckAn unavailable base-image tag was also tried. DCP's derived tunnel-client image uses Docker/BuildKit caching, so the tunnel could be reconstructed from cached layers even after removing the tagged derived image. This did not provide deterministic evidence about image-pull failure behavior and is not counted as a pass or failure for this configuration-wiring PR. Summary
Overall Result✅ PR VERIFIED The refreshed PR artifact matches the current head commit and all meaningful runtime, precedence, architecture, boundary, schema, and build scenarios passed. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests selector56 / 98 PR test projects · 6 PR jobs, from 18 changed files. Selected PR test projects (56 / 98)
Selected PR jobs (6)
How these were chosen — grouped by what changed
🔧 show 40
🔧 🧪 📦 affected project 📦 affected project 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #1809
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1809 targeting Documents the new Note This draft PR needs human review before merging. |

Description
DCP supports overriding the base image used by the container network tunnel, but Aspire did not expose that setting to AppHost or CLI users. This adds user-facing configuration so environments that require a customized or mirrored base image can configure the tunnel without modifying DCP directly.
Users can set the image through Aspire configuration:
aspire config set containerTunnel.baseImage example.com/aspire-tunnel:configuredThe setting is projected to
ASPIRE_CONTAINER_TUNNEL_BASE_IMAGEthrough a reusable AppHost configuration projector. .NET AppHosts receive it in their existing process environment, while polyglot AppHosts receive it through the existing AppHost server-session environment so the value reaches Aspire Hosting and DCP rather than the guest client process.The AppHost also supports
DcpPublisher:ContainerTunnelBaseImageand the--dcp-container-tunnel-base-imageargument. Explicit AppHost configuration and existing environment values retain precedence over the Aspire config value.Validation completed:
BaseImage.git diff --checkpassed.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?