Actions88
- 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
- Network Actions
- Volume Actions
- Swarm Actions
- Node Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
Overview
This node allows users to delete Docker images via the Portainer API. It is useful for managing Docker environments by removing unused or unwanted images, helping to free up disk space and maintain a clean container environment. Typical scenarios include automated cleanup of old images in CI/CD pipelines or manual removal of specific images that are no longer needed.
For example, you can delete an image by specifying its name or ID on a particular Docker endpoint managed by Portainer. Additional options allow forcing deletion even if the image is in use by stopped containers or preventing the pruning of untagged parent images.
Properties
| Name | Meaning |
|---|---|
| EndpointID Name or ID | The Docker endpoint (server) where the image resides. Choose from a list of available endpoints or specify an ID via expression. |
| Name | The name or ID of the Docker image to delete. |
| Force | (Optional) If true, forces removal of the image even if it is used by stopped containers or has other tags. |
| Noprune | (Optional) If true, prevents deletion of untagged parent images during the removal process. |
Output
The node outputs JSON data representing the response from the Portainer API after attempting to delete the specified Docker image. This typically includes status information about the deletion operation. The node does not output binary data.
Dependencies
- Requires access to a Portainer instance with API enabled.
- Requires an API key credential for authenticating requests to the Portainer API.
- The node uses the Portainer API endpoint
/api/endpoints/{endpointId}/dockerto perform operations. - The user must configure the node with the URL of the Portainer server and valid credentials.
Troubleshooting
Common issues:
- Invalid or missing
endpointId: Ensure the selected endpoint exists and is accessible. - Incorrect image name or ID: Verify the image identifier is correct and exists on the target endpoint.
- Insufficient permissions: The API key must have rights to delete images on the Portainer server.
- Network connectivity problems between n8n and the Portainer server.
- Invalid or missing
Error messages:
- 404 Not Found: The specified image or endpoint does not exist.
- 401 Unauthorized: Authentication failed; check API credentials.
- 409 Conflict: Image is in use and
forceoption was not set; try enablingForceto override.
Resolving these usually involves verifying credentials, endpoint selection, and image identifiers, as well as ensuring network access.