Ensure OutputPath is created in ResourceContainerImageBuilder#11831
Merged
davidfowl merged 1 commit intodotnet:mainfrom Oct 4, 2025
Merged
Ensure OutputPath is created in ResourceContainerImageBuilder#11831davidfowl merged 1 commit intodotnet:mainfrom
davidfowl merged 1 commit intodotnet:mainfrom
Conversation
When using docker/podman, and specifying an output path, building a docker image will fail if the directory isn't created. Ensure it is created.
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11831Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11831" |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where container image building would fail when specifying an output path that doesn't exist. The fix ensures the output directory is created before the docker/podman build process attempts to use it.
- Adds directory creation for the output path in the container image builder
- Updates test to verify the fix works with non-existent directories
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs | Adds Directory.CreateDirectory() call to ensure output path exists before building |
| tests/Aspire.Hosting.Tests/Publishing/ResourceContainerImageBuilderTests.cs | Updates test to use a non-existent directory path to verify the fix |
davidfowl
approved these changes
Oct 3, 2025
Member
|
9.5.2? 😄 |
Member
Author
Sure. The customer who hit this is also the approver of servicing requests. 😆 |
captainsafia
approved these changes
Oct 4, 2025
Member
Author
|
/backport to release/9.5 |
Contributor
|
Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/18317265173 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When using docker/podman, and specifying an output path, building a docker image will fail if the directory isn't created. Ensure it is created.