Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 16, 2025

Backport of #13576 to release/13.1

/cc @captainsafia @copilot

Customer Impact

Makes sure the the container runtime check is in place when doing single-image builds so that users get clearer errors when their deployments will fail because Docker/Podman is not running.

Testing

Automated and manual.

Risk

Low.

Regression?

No.

Copilot AI and others added 6 commits December 16, 2025 00:27
- Updated ResourcesRequireContainerRuntimeAsync to skip runtime check for resources with Archive destination
- Added runtime check to BuildImageAsync for Dockerfile resources
- Updated FakeContainerRuntime test helper to support isRunning parameter
- Added tests to verify the behavior (3 of 4 passing, 1 test needs refinement)

Co-authored-by: captainsafia <[email protected]>
…ibility

Reordered logic to check Dockerfile resources first, then Archive destination, preserving the original behavior for OCI + OutputPath combinations.

Co-authored-by: captainsafia <[email protected]>
- Move container runtime check to beginning of BuildImageAsync for all resource types
- Optimize ResourcesRequireContainerRuntimeAsync to call ResolveContainerBuildOptionsAsync once
- Only check Destination when OutputPath is present to avoid unnecessary callback

Co-authored-by: captainsafia <[email protected]>
- Added Destination property to ResolvedContainerBuildOptions class
- Set Destination in ResolveContainerBuildOptionsAsync from context
- Use Destination directly in ResourcesRequireContainerRuntimeAsync instead of calling ProcessContainerBuildOptionsCallbackAsync again
- Simplifies logic and avoids redundant callback invocations

Co-authored-by: captainsafia <[email protected]>
- Updated error log and exception messages to include container runtime name
- Changed from "Container runtime is not running" to "Container runtime '{name}' is not running"
- Updated test assertions to match new error message format
- Improves error diagnostics by showing which runtime (docker/podman) is being checked

Co-authored-by: captainsafia <[email protected]>
@github-actions
Copy link
Contributor Author

github-actions bot commented Dec 16, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13579

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13579"

@captainsafia
Copy link
Member

@copilot Remove the ContainerImageDestination related parts of this change.

Copy link
Contributor

Copilot AI commented Dec 16, 2025

@captainsafia I've opened a new pull request, #13580, to work on those changes. Once the pull request is ready, I'll request review from you.

…ions and improve error messages (#13580)

* Initial plan

* Remove ContainerImageDestination related parts as requested

- Removed Destination property from ResolvedContainerBuildOptions
- Reverted ResourcesRequireContainerRuntimeAsync to original logic
- Removed 5 tests that used ContainerImageDestination enum
- Reverted FakeContainerRuntime test helper changes
- Kept error message improvements with container runtime name

Co-authored-by: captainsafia <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: captainsafia <[email protected]>
@captainsafia captainsafia changed the title [release/13.1] Fix: Skip container runtime check for Archive destinations and improve error messages [release/13.1] Fix: Execute container runtime health check on single-image builds Dec 16, 2025
Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good later to think about how to best de-duplicate the code.

@joperezr joperezr merged commit cf92861 into release/13.1 Dec 16, 2025
286 checks passed
@joperezr joperezr deleted the backport/pr-13576-to-release/13.1 branch December 16, 2025 04:33
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants