# WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.Ollama](/reference/api/go/communitytoolkit.aspire.hosting.ollama.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`CommunityToolkit_Aspire_Hosting_OllamaOllamaResource`](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds a data volume to the Ollama container.

## Definition

```go
func (CommunityToolkit_Aspire_Hosting_OllamaOllamaResource) WithDataVolume(options ...*WithDataVolumeOptions) CommunityToolkit_Aspire_Hosting_OllamaOllamaResource
```

## Parameters

- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithDataVolumeOptions` argument.

- `Name` (`*string`) -- The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `IsReadOnly` (`*bool`) -- A flag that indicates if this is a read-only volume.

## Returns

[`CommunityToolkit_Aspire_Hosting_OllamaOllamaResource`](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`CommunityToolkit_Aspire_Hosting_OllamaOllamaResource`](/reference/api/go/communitytoolkit.aspire.hosting.ollama/communitytoolkit-aspire-hosting-ollamaollamaresource.md)
