# WithContainerFilesSource

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`ResourceWithContainerFiles`](/reference/api/go/aspire.hosting/resourcewithcontainerfiles.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a container files source annotation to the resource being built, specifying the path to the container files source.

## Definition

```go
func (ResourceWithContainerFiles) WithContainerFilesSource(sourcePath string) ResourceWithContainerFiles
```

## Parameters

- `sourcePath` (`string`) -- The path to the container files source to associate with the resource. Cannot be null.

## Returns

[`ResourceWithContainerFiles`](/reference/api/go/aspire.hosting/resourcewithcontainerfiles.md) -- The resource builder instance with the container files source annotation applied.

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

## Applies to

- [`ResourceWithContainerFiles`](/reference/api/go/aspire.hosting/resourcewithcontainerfiles.md)
