Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node interacts with the Portainer API to manage Docker images, specifically allowing you to retrieve the history of a Docker image. The "Get History" operation under the "Image" resource fetches the historical layers and metadata associated with a specific Docker image.

Common scenarios where this node is beneficial include:

  • Auditing or inspecting the build history of Docker images.
  • Debugging image creation by reviewing layer changes.
  • Automating compliance checks on image contents.
  • Integrating image history retrieval into CI/CD pipelines for reporting or validation.

For example, you can use this node to get the detailed history of an image identified by its ID in a given Docker environment managed by Portainer, helping you understand how the image was constructed.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the Docker image resides.
Image ID The unique identifier of the Docker image whose history you want to retrieve.

Output

The node outputs JSON data representing the history of the specified Docker image. This typically includes an array of objects describing each layer or step in the image's build process, such as created timestamps, commands executed, size, and other metadata.

No binary data output is involved in this operation.

Dependencies

  • Requires access to a Portainer instance with API enabled.
  • Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
  • The base URL of the Portainer API must be set in the credentials configuration.

Troubleshooting

  • Invalid Environment ID or Image ID: If the IDs provided do not exist or are incorrect, the API will return errors indicating the resource was not found. Verify the IDs before running the node.
  • Authentication Errors: Ensure that the API key credential is valid and has sufficient permissions to access the image history endpoint.
  • Network Issues: Connectivity problems between n8n and the Portainer server can cause request failures. Check network settings and firewall rules.
  • API Version Mismatch: Using an incompatible Portainer API version may result in unexpected errors. Confirm compatibility with your Portainer instance.

Links and References

Discussion