# DockerfileBuildAnnotation Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DockerfileBuildAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildannotation.md)
- Kind: `Properties`
- Members: `9`

Represents an annotation for customizing a Dockerfile build.

## BuildArguments

- Name: `BuildArguments`
- Modifiers: `get`
- Returns: `Dictionary<string, object?>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs#L35)

Gets the arguments to pass to the build.

```csharp
public Dictionary<string, object?> BuildArguments { get; }
```

## BuildSecrets

- Name: `BuildSecrets`
- Modifiers: `get`
- Returns: `Dictionary<string, object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs#L40)

Gets the secrets to pass to the build.

```csharp
public Dictionary<string, object> BuildSecrets { get; }
```

## ContextPath

- Name: `ContextPath`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs#L20)

Gets the path to the context directory for the build.

```csharp
public string ContextPath { get; }
```

## DockerfileFactory

- Name: `DockerfileFactory`
- Modifiers: `nullable` `get; init`
- Returns: `Func<DockerfileFactoryContext, Task<string>>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs)

Gets or sets the factory function that generates Dockerfile content dynamically. When set, this factory will be invoked to generate the Dockerfile content at build time, and the content will be written to a generated file path.

```csharp
public Func<DockerfileFactoryContext, Task<string>>? DockerfileFactory { get; init; }
```

## DockerfilePath

- Name: `DockerfilePath`
- Modifiers: `get`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs#L25)

Gets the path to the Dockerfile to use for the build.

```csharp
public string DockerfilePath { get; }
```

## HasEntrypoint

- Name: `HasEntrypoint`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs)

Gets or sets a value indicating whether an entry point is defined in the Dockerfile.

```csharp
public bool HasEntrypoint { get; set; }
```

## Remarks

Container images without an entry point are not considered compute resources.

## ImageName

- Name: `ImageName`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs)

Gets or sets the image name for the generated container image. When set, this will be used as the container image name instead of the value from ContainerImageAnnotation.

```csharp
public string? ImageName { get; set; }
```

## ImageTag

- Name: `ImageTag`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs)

Gets or sets the image tag for the generated container image. When set, this will be used as the container image tag instead of the value from ContainerImageAnnotation.

```csharp
public string? ImageTag { get; set; }
```

## Stage

- Name: `Stage`
- Modifiers: `nullable` `get`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuildAnnotation.cs#L30)

Gets the name of the build stage to use for the build.

```csharp
public string? Stage { get; }
```
