Skip to main content

Image Remove

Remove a container image from the target node:

$ osapi client container docker image-remove --image nginx:latest

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

Hostname: server1
Message: Image removed successfully

Force remove an image that may be in use:

$ osapi client container docker image-remove \
--image nginx:latest --force

Target a specific host:

$ osapi client container docker image-remove \
--image redis:7 --target web-01

Remove on all hosts:

$ osapi client container docker image-remove \
--image nginx:latest --target _all

JSON Output

Use --json to get the full API response:

$ osapi client container docker image-remove --image nginx:latest --json

Flags

FlagDescriptionDefault
--imageImage name or ID to remove (required)
--forceForce removal even if image is in usefalse
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any
-j, --jsonOutput raw JSON response