aspire do prepare-compose fails if ContainerRegistry is specified in MSBuild
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
When using the ContainerRegistry tag in your project file, it appears that the `aspire do prepare-compose` command will fail as it will try to publish to the remote repository with the local image name.
I believe the offending line is here: https://github.com/dotnet/aspire/blob/0157432551957eeaae7042b61d3e890bf3d34a1b/src/Aspire.Hosting/Publishing/ResourceContainerImageManager.cs#L330
### Expected Behavior
prepare-compose should either use the local registry or publish to the remote registry with the remote name and tag.
### Steps To Reproduce
In a csproj:
` image/remotename
harbor.someregistry.com
`
Then run aspire do prepare-compose. It will overwrite the ContainerRepository setting in the csproj but not the container registry.
### Exceptions (if any)
_No response_
### .NET Version info
_No response_
### Anything else?
Aspire.Hosting.Docker: 13.1.0-preview.1.25616.3
Aspire-CLI: 13.1.0+8a4db1775c3fbae1c602022b636299cb04971fde
Contributor guide
Assessment
This issue has not been assessed yet.