Skip to content
Docs Try Aspire
Docs Try

DockerfileFactoryContext

Handle
📦 Aspire.Hosting v13.4.0
interface DockerfileFactoryContext {
readonly resource: IResource;
}

Properties

property resource IResource get
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. ``` var containerAnnotation = context.Resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault(); var baseImage = containerAnnotation?.Image ?? "alpine:latest"; ```