Skip to content

Added support for publish projects as docker files as well.#7115

Merged
davidfowl merged 2 commits intomainfrom
davidfowl/publish-project-as-container
Jan 16, 2025
Merged

Added support for publish projects as docker files as well.#7115
davidfowl merged 2 commits intomainfrom
davidfowl/publish-project-as-container

Conversation

@davidfowl
Copy link
Copy Markdown
Contributor

@davidfowl davidfowl commented Jan 15, 2025

Description

We added support for publishing an executable as a container image, this does the same for projects.

Follow up to #7072

Fixes #3825

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • [] No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

- This is to round out our support for exe/project -> dockerfile
Comment thread src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs
Comment thread src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs Outdated
Comment thread src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs Outdated
Comment thread src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs
Comment on lines +665 to +668
// Even through we're adding a ContainerResource
// update the manifest publishing callback on the original ProjectResource
// so that the container resource is written to the manifest
return builder.WithManifestPublishingCallback(context =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does the original project's manifest publishing callback get invoked? We removed it from the ApplicationBuilder.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reference is in user code, this is just a fail safe.

Comment thread tests/Aspire.Hosting.Tests/PublishAsDockerfileTests.cs
@davidfowl davidfowl merged commit c5b60ea into main Jan 16, 2025
@davidfowl davidfowl deleted the davidfowl/publish-project-as-container branch January 16, 2025 01:29
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 15, 2025
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 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.

Support PublishAsDockerFile on project resources

2 participants