Skip to content

Publishing Docker image for project resource to GitHub fails due to ContainerRepository #8748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
VolkerGa opened this issue Apr 12, 2025 · 3 comments · May be fixed by #8790
Open
1 task done

Publishing Docker image for project resource to GitHub fails due to ContainerRepository #8748

VolkerGa opened this issue Apr 12, 2025 · 3 comments · May be fixed by #8790
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@VolkerGa
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm excited to try the new docker-compose publisher, knowing that it is still a preview. This is exactly what I am looking for to use in our current project!

I am trying to publish using the aspire.cli withe the docker-compose publisher. This works fine locally (not specifying the ContainerRegistry property in the project file) but fails as soon as I want to publish to GitHub.
Usually I set the property ContainerRepository in my project file to something like "company/packages/product".
However, aspire overwrites this property with the resource name which is "product" in my case.

Running aspire with the --debug switch shows that dotnet publish is being called with /p:ContainerRepository=product

ResourceContainerImageBuilder.BuildProjectContainerImageAsync() always adds that property to the dotnet call. Would it make sense to allow overriding this behavior?

Expected Behavior

I would expect Aspire to use the Property ContainerRepository as defined in the project file. This is how dotnet publish generates the image name.

Steps To Reproduce

No response

Exceptions (if any)

There is no exception being displayed. The publishing step seems to run forever in this case.

.NET Version info

.Net SDK 9.0.203

Anything else?

Aspire 9.2
aspire.cli 9.2.0-preview.1.25209.2

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

davidfowl commented Apr 12, 2025

Yes the plan is to support this we just didn’t complete it in the time 9.2 time frame. You should be able to docker push after the normal container build takes place as a workaround. Then you can update the image registry via the env variables

@VolkerGa
Copy link
Author

Thank you for the quick response! I will use the proposed workaround for the meantime.

@Alirexaa
Copy link
Contributor

I will send a PR.

@Alirexaa Alirexaa linked a pull request Apr 15, 2025 that will close this issue
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants