Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows interaction with Docker through the Portainer API, specifically enabling users to retrieve Docker images from a specified endpoint managed by Portainer. It is useful in automation workflows where you need to fetch details or data about Docker images hosted on remote Docker environments managed via Portainer.

Common scenarios include:

  • Automating deployment pipelines that require fetching image metadata before deployment.
  • Integrating Docker image management into broader infrastructure automation.
  • Querying specific Docker images by name or ID for auditing or reporting purposes.

For example, you might use this node to get an image by its name from a particular Docker endpoint and then pass that information downstream for further processing or deployment.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint managed by Portainer to access. You can select from a list of available endpoints or specify an ID directly using an expression.
Name The Docker image name or ID to retrieve. This is required to specify which image you want to get from the selected endpoint.
Additional Fields Optional extra parameters:
- Platform: A JSON string describing the OCI platform (e.g., OS, architecture, variant) to select a platform-specific image if the image supports multiple platforms. If omitted, the full multi-platform image is retrieved.

Output

The node outputs JSON data representing the Docker image retrieved from the specified endpoint. The structure corresponds to the Docker image details as returned by the Portainer API's Docker image GET endpoint.

If the image is multi-platform and a platform filter is provided, the output will be specific to that platform variant.

No binary data output is indicated by the source code.

Dependencies

  • Requires a valid connection to a Portainer instance with API access.
  • Needs an API key or token credential configured in n8n to authenticate against the Portainer API.
  • The node dynamically loads available Docker endpoints from Portainer to populate the endpoint selection property.

Troubleshooting

  • Invalid Endpoint ID: If the specified endpoint ID does not exist or is inaccessible, the node will fail. Ensure the endpoint exists in Portainer and the API credentials have permission to access it.
  • Image Not Found: Specifying an incorrect image name or ID will result in an error or empty response. Verify the image name/ID is correct on the target Docker endpoint.
  • Platform JSON Malformed: If the platform field is provided but contains invalid JSON, the request may fail. Ensure the platform string is valid JSON matching the expected OCI platform format.
  • Authentication Errors: Incorrect or missing API credentials will cause authentication failures. Confirm the API key/token is correctly set up in n8n credentials.

Links and References

Discussion