# DockerfileBuilderCallbackAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/DockerfileBuilderCallbackAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

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

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class DockerfileBuilderCallbackAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Constructors

- [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation/constructors.md#constructor) -- Initializes a new instance of the [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation.md) class.
- [DockerfileBuilderCallbackAnnotation(Func<DockerfileBuilderCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation/constructors.md#constructor-func-dockerfilebuildercallbackcontext-task) -- Initializes a new instance of the [DockerfileBuilderCallbackAnnotation](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation.md) class with an initial callback.

## Properties

- [Callbacks](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation/properties.md#callbacks) : `IReadOnlyList<Func<DockerfileBuilderCallbackContext, Task>>` `get` -- Gets the list of callback functions that will be invoked during the Dockerfile build process.

## Methods

- [AddCallback(Func<DockerfileBuilderCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/dockerfilebuildercallbackannotation/methods.md#addcallback-func-dockerfilebuildercallbackcontext-task) `experimental` -- Adds a callback function to be invoked during the Dockerfile build process.
