winops_container_exec
Runs commands inside a specified Docker container, piping stdin directly to the process. Returns JSON with stdout, stderr, and exit code for automation.
Instructions
Execute a command inside a Docker container.
Uses subprocess directly (not CMD/PowerShell wrapper) to avoid nested-quoting
issues and list2cmdline mangling. stdin_data is piped directly to the container
command — no need for docker cp + exec dance.
Return Format
{"success": bool, "stdout": str, "stderr": str, "exit_code": int}Examples
exec(container="postgres", command="psql -U user -d db -c 'SELECT 1'")
exec(container="python-app", command="python /tmp/run.py", stdin_data="input data")
exec(container="nginx", command="nginx -t", timeout_seconds=10)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | User to run as (e.g. 'root'). | |
| command | Yes | Command to execute inside the container. | |
| workdir | No | Working directory inside the container. | |
| container | Yes | Container name or ID. | |
| stdin_data | No | Text to pipe to stdin of the command. | |
| timeout_seconds | No | Hard timeout 1-300s. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||