Report unsupported WSLc Dockerfile build options before runtime readiness errors
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with ContainerResourceBuilderExtensions.EnsureBuildAndPushPipelineAnnotations, ResourceContainerImageManager.BuildImageAsync, and WslcContainerRuntime.BuildImageAsync to trace validation and readiness ordering in both entry points. Check the existing SDK publishing validation and add regression coverage for unsupported platform or archive options with a stopped runtime, alongside supported build recovery. Done means capability errors appear before readiness errors without evaluating build-option callbacks twice or probing runtime health for rejected builds.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When WSLc is selected but not running, an unsupported Dockerfile publishing configuration reports a runtime-readiness error before reporting the capability limitation. Starting WSLc and retrying then reveals that the requested build could never succeed with that runtime.
For example, Dockerfile publishing defaults to a selected linux/amd64 platform, but WSLc does not support Dockerfile build platform selection. This is a diagnostic-order issue; the unsupported build is still rejected before execution.
Expected Behavior
Report the unsupported Dockerfile option and supported alternatives before attempting runtime readiness checks or prompting the user to start WSLc. Preserve existing readiness recovery for supported builds.
The behavior should be consistent through both the image manager and the normal publish/deploy pipeline.
Steps To Reproduce
On Windows with the WSLc publishing support from #21009:
- Configure an AppHost with a Dockerfile resource, leaving the default publish target platform in place:
var builder = DistributedApplication.CreateBuilder(args);
builder.AddDockerfile("service", "./service");
builder.Build().Run();
- Select WSLc with
ASPIRE_CONTAINER_RUNTIME=wslcand ensure its runtime/session is stopped. - Run the image-build pipeline, for example
aspire do build --apphost <apphost-path> --non-interactive. - Observe a runtime-readiness error. Start WSLc and retry; the operation then reports that platform-selected Dockerfile builds are unsupported.
These steps describe the code-path ordering identified during review; a stopped-session live reproduction has not been performed for this follow-up.
Exceptions (if any)
Depending on the entry point, runtime readiness reports that WSLc is not running or unhealthy. After readiness succeeds, the capability check reports:
WSLc does not support selecting a platform for Dockerfile image builds. Use Docker or Podman, or set TargetPlatform to null with WithContainerBuildOptions to build for the WSLc host platform.
Aspire doctor output
N/A — follow-up identified by tracing publishing validation and readiness ordering.
Anything else?
Follow-up to #21009 and https://github.com/microsoft/aspire/pull/21009#discussion_r4487899820.
Relevant code:
// ContainerResourceBuilderExtensions.EnsureBuildAndPushPipelineAnnotations
DependsOnSteps = [WellKnownPipelineSteps.BuildPrereq, WellKnownPipelineSteps.CheckContainerRuntime]
The Dockerfile build step depends on the pipeline's runtime health check, so moving validation only within ResourceContainerImageManager.BuildImageAsync will not correct normal CLI execution ordering. The manager also performs its own health check before invoking WslcContainerRuntime.BuildImageAsync, where unsupported Dockerfile options are currently rejected.
Address both entry points without evaluating container build-option callbacks twice or introducing inconsistent resolved options. The SDK publishing path already rejects its unsupported WSLc configurations before its per-build readiness check.
Suggested regression coverage: stopped runtime plus unsupported platform/archive options should report the capability limitation first through direct-manager and pipeline execution paths; supported Dockerfile builds should retain existing health checks and interactive startup recovery. Pure capability rejection should not invoke the runtime health probe.
- Dominant language
- C#
- Stars
- 6.4k
- Forks
- 1k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 406
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/aspire
-
Aspire.Hosting.Yarp flattens TimeSpan cluster settings (ActivityTimeout, health-check intervals) into per-property env vars the YARP container ignoresPossibly taken @itsrayeedscodespace claimed this 3 days ago. Openarea-integrations
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Dashboard structured logs toolbar overlaps the resource name and wraps poorly in constrained layoutsOpenarea-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
area-templates
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
All issues in microsoft/aspire
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
ShareX/XerahS#316 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#16825 ·
Maintainers usually reply within 1 day
-
ci-flake kind:tests size:S type:bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
elsa-workflows/elsa-foundation#4058 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
games-on-whales/wolf-ui#23 ·
-
SkillsOpenwayfinder:grilling
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
DigiBanks99/lopen#37 ·