# DockerfileBuilderCallbackAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation.md)
- Kind: `Constructors`
- Members: `2`

Represents an annotation for providing callbacks to programmatically modify Dockerfile builds.

## DockerfileBuilderCallbackAnnotation

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuilderCallbackAnnotation.cs#L14-L21)

Initializes a new instance of the [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation.md) class.

```csharp
public class DockerfileBuilderCallbackAnnotation
{
    public DockerfileBuilderCallbackAnnotation()
    {
        // ...
    }
}
```

## DockerfileBuilderCallbackAnnotation(Func<DockerfileBuilderCallbackContext, Task>)

- Name: `Constructor(Func<DockerfileBuilderCallbackContext, Task>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/DockerfileBuilderCallbackAnnotation.cs#L14-L31)

Initializes a new instance of the [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation.md) class with an initial callback.

```csharp
public class DockerfileBuilderCallbackAnnotation
{
    public DockerfileBuilderCallbackAnnotation(
        Func<DockerfileBuilderCallbackContext, Task> callback)
    {
        // ...
    }
}
```

## Parameters

- `callback` (`Func<DockerfileBuilderCallbackContext, Task>`)
  The initial callback function that will be invoked during the Dockerfile build process.
