Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Oct 3, 2025

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.

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.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 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 -- 11831

Or

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Oct 3, 2025
@davidfowl
Copy link
Member

9.5.2? 😄

@eerhardt
Copy link
Member Author

eerhardt commented Oct 3, 2025

9.5.2? 😄

Sure. The customer who hit this is also the approver of servicing requests. 😆

@davidfowl davidfowl merged commit 521c0d5 into dotnet:main Oct 4, 2025
303 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 4, 2025
@eerhardt
Copy link
Member Author

eerhardt commented Oct 7, 2025

/backport to release/9.5

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants