# DockerfileFactoryContext

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

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"; ```
