Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node interacts with Docker through the Portainer API, specifically focusing on retrieving the history of a Docker image. It is useful for users who want to inspect the layers and changes made to a particular Docker image over time. Common scenarios include auditing image contents, debugging image builds, or verifying image provenance.

For example, a DevOps engineer might use this node to fetch the detailed history of a specific image to understand what commands were run during its creation or to verify that certain security patches were applied.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Portainer endpoint to access. You can select from a list of available endpoints or specify an ID directly using an expression. This determines which Docker environment the request targets.
Name The name or ID of the Docker image whose history you want to retrieve.
Additional Fields Optional extra parameters:
- Platform: A JSON-encoded OCI platform specification to select a platform variant of a multi-platform image (e.g., {"os": "linux", "architecture": "arm", "variant": "v5"}). Defaults to the host platform if omitted.

Output

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

No binary data output is indicated by the source code or properties.

Dependencies

  • Requires access to a Portainer API instance.
  • Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
  • The user must have at least one Portainer endpoint configured and accessible.
  • The node uses the Portainer API endpoint /api/endpoints/{endpointId}/docker/image/{name}/history (inferred from the base URL and operation context).

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the selected endpoint exists and is reachable.
    • Incorrect image name or ID: Verify the image identifier is correct and exists on the target Docker environment.
    • Platform specification errors: If specifying a platform, ensure the JSON is valid and matches a supported platform variant; otherwise, the API may return an error.
    • Authentication failures: Confirm that the API key credential is valid and has sufficient permissions.
  • Error messages:

    • 404 Not Found: The image or endpoint does not exist.
    • 401 Unauthorized: Authentication failed due to invalid credentials.
    • 400 Bad Request: Malformed platform JSON or invalid query parameters.

Resolving these usually involves checking the input parameters, ensuring connectivity to the Portainer API, and validating credentials.

Links and References

Discussion