DockerfileFactoryContext.Resource Property
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.
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