# ContainerBuildOptionsCallbackContext Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerBuildOptionsCallbackContext](/reference/api/csharp/aspire.hosting/containerbuildoptionscallbackcontext.md)
- Kind: `Properties`
- Members: `11`

Context for configuring container build options via a callback.

## CancellationToken

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

Gets the cancellation token.

```csharp
public CancellationToken CancellationToken { get; }
```

## Destination

- Name: `Destination`
- Modifiers: `nullable` `get; set`
- Returns: [ContainerImageDestination?](/reference/api/csharp/aspire.hosting/containerimagedestination.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs)

Gets or sets the destination for the container image.

```csharp
public ContainerImageDestination? Destination { get; set; }
```

## ExecutionContext

- Name: `ExecutionContext`
- Modifiers: `nullable` `get`
- Returns: [DistributedApplicationExecutionContext?](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs#L87)

Gets the distributed application execution context.

```csharp
public DistributedApplicationExecutionContext? ExecutionContext { get; }
```

## ImageFormat

- Name: `ImageFormat`
- Modifiers: `nullable` `get; set`
- Returns: [ContainerImageFormat?](/reference/api/csharp/aspire.hosting/containerimageformat.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs)

Gets or sets the container image format.

```csharp
public ContainerImageFormat? ImageFormat { get; set; }
```

## LocalImageName

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

Gets or sets the local image name for the built container.

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

## LocalImageTag

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

Gets or sets the local image tag for the built container.

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

## Logger

- Name: `Logger`
- Modifiers: `get`
- Returns: `ILogger`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs#L77)

Gets the logger instance.

```csharp
public ILogger Logger { get; }
```

## OutputPath

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

Gets or sets the output path for the container archive.

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

## Resource

- Name: `Resource`
- Modifiers: `get`
- Returns: [IResource](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs#L67)

Gets the resource being built.

```csharp
public IResource Resource { get; }
```

## Services

- Name: `Services`
- Modifiers: `get`
- Returns: `IServiceProvider`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs#L72)

Gets the service provider.

```csharp
public IServiceProvider Services { get; }
```

## TargetPlatform

- Name: `TargetPlatform`
- Modifiers: `nullable` `get; set`
- Returns: [ContainerTargetPlatform?](/reference/api/csharp/aspire.hosting/containertargetplatform.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerBuildOptionsCallbackAnnotation.cs)

Gets or sets the target platform for the container.

```csharp
public ContainerTargetPlatform? TargetPlatform { get; set; }
```
