Share via


DockerfileFactoryContext.Resource Property

Definition

Gets the resource for which the Dockerfile is being generated.

This allows factory functions to query resource annotations and properties to customize the generated Dockerfile.

<example>
var containerAnnotation = context.Resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault();
var baseImage = containerAnnotation?.Image ?? "alpine:latest";
</example>
public Aspire.Hosting.ApplicationModel.IResource Resource { get; init; }
member this.Resource : Aspire.Hosting.ApplicationModel.IResource with get, set
Public Property Resource As IResource

Property Value

Applies to