Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker images. Specifically, the Delete Image operation allows users to delete a Docker image from a specified environment (endpoint) in Portainer. This is useful for cleaning up unused or outdated Docker images to free storage space or maintain an organized Docker registry.

Typical use cases include:

  • Automating cleanup of old or dangling Docker images in CI/CD pipelines.
  • Managing Docker images across multiple environments/endpoints via Portainer.
  • Enforcing image lifecycle policies by programmatically deleting images.

Example: Deleting an image with ID abc123def456 from environment ID 1, optionally forcing deletion even if the image is currently in use.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the image resides.
Image ID The unique identifier of the Docker image to be deleted.
Force Delete Boolean flag indicating whether to force deletion even if the image is currently in use.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to delete the image. Typically, this will confirm successful deletion or provide error details if the operation failed.

No binary data output is involved in this operation.

Dependencies

  • Requires a configured Portainer API credential with:

    • Base URL of the Portainer instance.
    • An API key or token for authentication.
  • The node sends HTTP DELETE requests to the Portainer API endpoint corresponding to the target environment and image.

Troubleshooting

  • Common Issues:

    • Invalid or missing Environment ID or Image ID parameters.
    • Insufficient permissions or invalid API key leading to authorization errors.
    • Attempting to delete an image that is currently in use without setting "Force Delete" to true.
    • Network connectivity issues to the Portainer API endpoint.
  • Error Messages & Resolutions:

    • 401 Unauthorized: Check API key validity and permissions.
    • 404 Not Found: Verify that the Environment ID and Image ID are correct and exist.
    • 409 Conflict or similar when image is in use: Enable "Force Delete" to override.
    • 500 Internal Server Error: Check Portainer server status and logs.

Links and References

Discussion