# ContainerResource.WithContainerRuntimeArgs

- 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`

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

## Definition

```go
type ContainerResource interface {
    // ... omitted for brevity
    WithContainerRuntimeArgs(args []string) ContainerResource
}
```

## Signature

```go
WithContainerRuntimeArgs(args []string) ContainerResource
```

## Parameters

- `args` (`[]string`) -- The arguments to be passed to the container runtime run command when the container resource is started.

## 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`
