# DockerfileFactoryContext

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.6.4`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/c89352703f78ae46de90fbf751ed8b52b77b89bf)

Provides context for Dockerfile factory functions.

## Definition

```typescript
interface DockerfileFactoryContext {
  readonly resource: IResource;
}
```

## Properties

- `resource`: [IResource](/reference/api/typescript/aspire.hosting/iresource.md) `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"; ```
