# WithImagePullPolicy

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

Sets the pull policy for the container resource.

## Definition

```go
func (ContainerResource) WithImagePullPolicy(pullPolicy ImagePullPolicy) ContainerResource
```

## Parameters

- `pullPolicy` ([`ImagePullPolicy`](/reference/api/go/aspire.hosting/imagepullpolicy.md)) -- The pull policy behavior for the container resource.

## Returns

[`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md) -- The resource builder.

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

## Applies to

- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
