run_container
Start a container from an image with configurable CPU, memory, ports, networking, environment variables, volumes, and command overrides to launch isolated application workloads.
Instructions
Start a container from an image with optional resource constraints, networking, ports, env vars,
volume mounts, and more. Pass a command to run via args_override.
scheme selects registry http or https explicitly; CLI 1.4.1 defaults to https.
Use shm_size to set the size of /dev/shm (e.g. "1G").
network_aliases (Apple Container 1.6.0+) gives the container extra DNS names on its
network (the "default" network when network is unset). Exact aliases need two labels
("api.test"). A leading-dot alias (".api.test") matches every name below it and must sit
below the container's own hostname or one of its exact aliases. Aliases are fixed at
creation and resolve only under a DNS domain registered with `container system dns create`.
network also accepts per-attachment options directly, e.g. "my-net,mtu=1400".
read_only_paths and masked_paths (Apple Container 1.2.1+, EXPERIMENTAL upstream) add extra
in-guest paths to the runtime's default read-only/masked lists — they only tighten isolation.
The upstream CLI also accepts a "NONE" sentinel there to clear the defaults and widen the
container's attack surface; this tool rejects that value and only supports the additive form.
Examples:
run_container("debian", memory="4g", cpus=2, ports=["8080:8080"])
run_container("ubuntu", rm=True, detach=False, args_override=["bash", "-c", "echo hi"])
run_container("my-app", rosetta=True, platform="linux/amd64")
run_container("myapp", masked_paths=["/proc/kcore"], read_only_paths=["/etc"])
run_container("nginx", name="gateway", network_aliases=["api.test", ".api.test"])
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image": "<image>"
},
"name": "run_container"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rm | No | ||
| env | No | ||
| cpus | No | ||
| name | No | ||
| user | No | ||
| image | Yes | ||
| mount | No | ||
| ports | No | ||
| detach | No | ||
| labels | No | ||
| memory | No | ||
| scheme | No | ||
| network | No | ||
| rosetta | No | ||
| volumes | No | ||
| workdir | No | ||
| env_file | No | ||
| platform | No | ||
| shm_size | No | ||
| entrypoint | No | ||
| init_image | No | ||
| masked_paths | No | ||
| args_override | No | ||
| network_aliases | No | ||
| read_only_paths | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |