# ContainerResource.WithImagePullPolicy

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ContainerResource](/reference/api/go/aspire.hosting/containerresource.md)
- Version: `17.0.0`
- Kind: `method`

Sets the pull policy for the container resource.

## Definition

```go
type ContainerResource interface {
    // ... omitted for brevity
    WithImagePullPolicy(pullPolicy ImagePullPolicy) ContainerResource
}
```

## Signature

```go
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()`.

## Defined on

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