# withImage

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.2.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Sets the container image

## Definition

```typescript
interface ContainerResource {
  // ... omitted for brevity
  withImage(
    image: string,
    tag?: string): ContainerResource
}
```

## Parameters

- `image` (`string`)
- `tag` (`string`) `optional`

## Returns

[ContainerResource](/reference/api/typescript/aspire.hosting/containerresource.md) `builder`

## Applies to

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