Skip to main content

Stop

Stop a running container on the target node:

$ osapi client container docker stop --id a1b2c3d4e5f6

Job ID: 550e8400-e29b-41d4-a716-446655440000

Hostname: server1
Message: container stopped

Stop with a custom timeout (seconds to wait before killing):

$ osapi client container docker stop --id my-nginx --timeout 30

Target a specific host:

$ osapi client container docker stop --id my-nginx --target web-01

JSON Output

Use --json to get the full API response:

$ osapi client container docker stop --id a1b2c3d4e5f6 --json

Flags

FlagDescriptionDefault
--idContainer ID or name to stop (required)
--timeoutSeconds to wait before killing the container10
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any
-j, --jsonOutput raw JSON response