Portainer icon

Portainer

Work with Portainer API data to manage Docker

Image → Delete

AI-generated

Overview

This node operation deletes a Docker image from a specified environment in Portainer. It is useful for managing Docker images by removing those that are no longer needed, freeing up storage space, or cleaning up unused images. For example, a user can delete an outdated or unused Docker image by specifying the environment ID and image ID, optionally forcing the deletion even if the image is in use.

Use Case Examples

  1. Deleting an unused Docker image to free up disk space.
  2. Removing an outdated image version from a specific environment in Portainer.

Properties

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

Output

JSON

  • statusCode - HTTP status code returned by the delete operation.
  • body - Response body from the Portainer API after attempting to delete the image.

Dependencies

  • Requires Portainer API access with an API key credential.

Troubleshooting

  • Ensure the Environment ID and Image ID are correct and exist in Portainer.
  • If deletion fails due to the image being in use, try enabling the 'Force Delete' option.
  • Check API key permissions to confirm the user has rights to delete images.
  • Verify network connectivity to the Portainer API endpoint.
  • If SSL issues occur, consider enabling the option to ignore SSL certificate validation.

Links

Discussion