ProjectResourceBuilderExtensions.PublishAsDockerFile<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds support for containerizing this ProjectResource during deployment.
The resulting container image is built, and when the optional configure
action is provided,
it is used to configure the container resource.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> PublishAsDockerFile<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Action<Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ContainerResource>>? configure = default) where T : Aspire.Hosting.ApplicationModel.ProjectResource;
static member PublishAsDockerFile : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ProjectResource)> * Action<Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ContainerResource>> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.ProjectResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.ProjectResource)
<Extension()>
Public Function PublishAsDockerFile(Of T As ProjectResource) (builder As IResourceBuilder(Of T), Optional configure As Action(Of IResourceBuilder(Of ContainerResource)) = Nothing) As IResourceBuilder(Of T)
Type Parameters
- T
Type of executable resource
Parameters
- builder
- IResourceBuilder<T>
Resource builder
- configure
- Action<IResourceBuilder<ContainerResource>>
Optional action to configure the container resource
Returns
A reference to the IResourceBuilder<T>.
Remarks
When the executable resource is converted to a container resource, the arguments to the executable are not used. This is because arguments to the project often contain physical paths that are not valid in the container. The container can be set up with the correct arguments using the configure
action.