# ContainerMountAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerMountAnnotation](/reference/api/csharp/aspire.hosting/containermountannotation.md)
- Kind: `Constructors`
- Members: `1`

Represents a mount annotation for a container resource.

## ContainerMountAnnotation(string?, string, ContainerMountType, bool)

- Name: `Constructor(string?, string, ContainerMountType, bool)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerMountAnnotation.cs#L22-L46)

Instantiates a mount annotation that specifies the details for a container mount.

```csharp
public sealed class ContainerMountAnnotation
{
    public ContainerMountAnnotation(
        string? source,
        string target,
        ContainerMountType type,
        bool isReadOnly)
    {
        // ...
    }
}
```

## Parameters

- `source` (`string?`)
  The source path if a bind mount or name if a volume. Can be `null` if the mount is an anonymous volume.
- `target` (`string`)
  The target path of the mount.
- `type` ([ContainerMountType](/reference/api/csharp/aspire.hosting/containermounttype.md))
  The type of the mount.
- `isReadOnly` (`bool`)
  A value indicating whether the mount is read-only.
