Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node interacts with Docker through the Portainer API, specifically allowing users to retrieve privileges of a Docker plugin on a specified endpoint. It is useful in scenarios where you need to programmatically check what permissions or capabilities a particular Docker plugin has within a given Docker environment managed by Portainer.

Practical examples include:

  • Automating audits of Docker plugins' privileges across multiple endpoints.
  • Integrating privilege checks into CI/CD pipelines to ensure compliance before deployment.
  • Monitoring and managing plugin permissions centrally via workflows.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint managed by Portainer where the plugin resides. You can select from a list of available endpoints or specify an ID directly.
Remote The name of the Docker plugin whose privileges you want to retrieve. The :latest tag is optional and assumed if omitted.

Output

The node outputs JSON data representing the privileges associated with the specified Docker plugin on the selected endpoint. This typically includes details about what actions the plugin is authorized to perform within the Docker environment.

If the plugin provides any binary data (not indicated here), it would be summarized as related to plugin metadata or configuration, but this node primarily deals with JSON privilege information.

Dependencies

  • Requires access to a Portainer instance with its API enabled.
  • Needs an API key or token credential for authenticating requests to the Portainer API.
  • The node depends on the Portainer API endpoint /api/endpoints/{endpointId}/docker to interact with Docker resources.
  • The node uses a method to dynamically load available endpoints from Portainer (getEndpoints).

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the endpoint exists and is accessible.
    • Incorrect plugin name or tag: Verify the plugin name and optionally specify the correct tag.
    • Authentication failures: Confirm that the API key/token is valid and has sufficient permissions.
    • Network connectivity problems between n8n and the Portainer server.
  • Error messages:

    • Unauthorized or 401 errors: Check API credentials and permissions.
    • 404 Not Found: The specified endpoint or plugin does not exist.
    • Timeout or connection errors: Verify network settings and Portainer availability.

Resolving these usually involves verifying credentials, endpoint IDs, plugin names, and network connectivity.

Links and References

Discussion