Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node allows users to interact with Docker through the Portainer API. Specifically, it enables inspecting Docker nodes by specifying an endpoint and a node identifier. This is useful for scenarios where you want to programmatically retrieve detailed information about Docker nodes managed via Portainer, such as monitoring node status, configuration, or metadata within automated workflows.

Practical examples include:

  • Automating infrastructure audits by fetching node details regularly.
  • Integrating Docker node inspection into CI/CD pipelines to verify environment states.
  • Triggering alerts or actions based on node health or properties retrieved from Portainer.

Properties

Name Meaning
EndpointID Name or ID The Portainer endpoint to use for accessing Docker. Choose from a list of available endpoints or specify an ID via expression.
Id The ID or name of the Docker node to inspect.

Output

The node outputs JSON data representing the inspected Docker node's details as returned by the Portainer API. This typically includes node metadata, status, and configuration information. There is no binary output.

Dependencies

  • Requires access to a Portainer instance with its API enabled.
  • Needs an API authentication token credential configured in n8n to authenticate requests to the Portainer API.
  • The node uses the Portainer API endpoint /api/endpoints/{endpointId}/docker to perform operations.

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the selected endpoint exists and is accessible.
    • Incorrect node ID: Verify that the node ID or name provided matches an existing Docker node in Portainer.
    • Authentication errors: Confirm that the API key or token credential is valid and has sufficient permissions.
    • Network connectivity problems between n8n and the Portainer server.
  • Error messages:

    • Unauthorized or 401 errors indicate invalid credentials.
    • 404 errors may mean the endpoint or node ID does not exist.
    • Timeout or connection refused errors suggest network or server availability issues.

Resolving these usually involves verifying credentials, endpoint configurations, and network accessibility.

Links and References

Discussion