portainer_container_exec
Execute a command inside a running container and return its output, with optional working directory and user settings.
Instructions
Execute a command inside a running container and return its output.
Args: container_id: Container ID or name command: Shell command to execute (run via sh -c) workdir: Working directory inside the container user: User to run the command as (e.g. 'root', '1000:1000') endpoint_id: Target endpoint ID (uses default if omitted)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_id | Yes | ||
| command | Yes | ||
| workdir | No | ||
| user | No | ||
| endpoint_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |