container_run
Run a new WSL container with configurable resources, ports, volumes, and environment variables. Supports foreground or background execution.
Instructions
Run a new WSL container. Defaults to foreground; use detach for background.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rm | No | Remove container after it stops | |
| env | No | Environment variables (key=value pairs) | |
| tty | No | Allocate a pseudo-TTY | |
| cpus | No | CPU count (e.g. 0.5, 1, 2.5) | |
| name | No | Container name | |
| image | Yes | Container image name (e.g., ubuntu:24.04) | |
| detach | No | Run container in background | |
| memory | No | Memory limit (e.g. 512M, 1G) | |
| volume | No | Volume bind mounts (e.g. ['/host:/container']) | |
| command | No | Command to run in the container | |
| publish | No | Port mappings (e.g. ['8080:80', '443:443']) | |
| workdir | No | Working directory inside the container | |
| commandArgs | No | Arguments for the command | |
| interactive | No | Keep stdin open |