Actions107
- Node Actions
- Network Actions
- Container Actions
- Container List
- Container Create
- Container Inspect
- Container Top
- Container Logs
- Container Changes
- Container Export
- Container Stats
- Container Resize
- Container Start
- Container Stop
- Container Restart
- Container Kill
- Container Update
- Container Rename
- Container Pause
- Container Unpause
- Container Attach
- Container Attach Websocket
- Container Wait
- Container Delete
- Container Archive Info
- Container Archive
- Put Container Archive
- Container Prune
- Image Actions
- Volume Actions
- Swarm Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
- Config Actions
- Plugin Actions
- Distribution Actions
- Session Actions
Overview
This node allows you to interact with Docker volumes through the Portainer API, specifically enabling you to prune (clean up) unused or dangling Docker volumes on a selected Docker endpoint. Pruning volumes helps free up disk space by removing volumes that are no longer referenced by any containers.
Common scenarios where this node is useful include:
- Automating cleanup of unused Docker volumes in CI/CD pipelines.
- Scheduled maintenance tasks to keep Docker hosts tidy.
- Managing storage resources efficiently in environments with many ephemeral containers.
For example, you can configure the node to prune all anonymous volumes or apply filters to prune only volumes matching specific labels.
Properties
| Name | Meaning |
|---|---|
| EndpointID Name or ID | Select the Docker endpoint (server) where the prune operation will be executed. You can choose from a list of available endpoints or specify an ID using an expression. |
| Additional Fields | Optional additional parameters for pruning volumes: |
| - Filters | JSON-encoded filters to refine which volumes to prune. Supported filters include: • label — prune volumes with or without specified labels (e.g., label=key, label=key=value, label!=key).• all=true — prune all local volumes, not just anonymous ones. |
Output
The node outputs JSON data representing the result of the prune operation. This typically includes information about how many volumes were deleted and their IDs. The output does not include binary data.
Example output structure (simplified):
{
"VolumesDeleted": [
"volume_id_1",
"volume_id_2"
],
"SpaceReclaimed": 12345678
}
VolumesDeleted: Array of volume IDs that were removed.SpaceReclaimed: Amount of disk space freed in bytes.
Dependencies
- Requires access to a Portainer API instance managing Docker endpoints.
- An API key credential or token with sufficient permissions to perform volume pruning on the selected endpoint.
- The node expects the base URL of the Portainer API and the endpoint ID to be configured properly.
Troubleshooting
- Authentication errors: Ensure the API key/token used has the necessary permissions and the base URL is correct.
- Endpoint not found: Verify the selected endpoint ID exists and is reachable.
- Invalid filters: Filters must be valid JSON strings and follow the expected format; otherwise, the API may reject the request.
- No volumes pruned: If no volumes meet the filter criteria or if there are no dangling volumes, the response will indicate zero volumes deleted.