Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node allows users to interact with Docker through the Portainer API, specifically targeting Docker endpoints managed by Portainer. The "Exec Inspect" operation retrieves detailed information about a specific Docker exec instance identified by its ID on a selected Docker endpoint. This is useful for monitoring or debugging running containers by inspecting commands executed inside them.

Practical examples include:

  • Inspecting the status and details of a command executed inside a container.
  • Retrieving metadata about an exec instance to verify its execution state or output.
  • Integrating Docker container management into automated workflows that require runtime inspection.

Properties

Name Meaning
EndpointID Name or ID Selects the Docker endpoint managed by Portainer to target. Options are dynamically loaded from available endpoints. You can choose from the list or specify an ID via expression.
Id The unique identifier of the Docker exec instance to inspect. This is required to fetch the exec details.

Output

The node outputs JSON data representing the inspected Docker exec instance. This typically includes details such as the exec instance's configuration, running state, exit code, process information, and other metadata returned by the Portainer API for the specified exec ID.

No binary data output is indicated.

Dependencies

  • Requires access to a Portainer API endpoint managing Docker environments.
  • Needs an API authentication credential (an API key or token) configured in n8n to authenticate requests to the Portainer API.
  • The node uses the Portainer API base URL and endpoint ID to construct requests.

Troubleshooting

  • Common issues:

    • Invalid or missing endpointId: Ensure the selected endpoint exists and is accessible.
    • Incorrect id for the exec instance: Verify the exec instance ID is correct and corresponds to an existing exec command.
    • Authentication errors: Confirm the API credentials are valid and have sufficient permissions.
    • Network or connectivity problems to the Portainer server.
  • Error messages:

    • Unauthorized or 401 errors indicate invalid or missing API credentials.
    • 404 Not Found may mean the exec instance ID or endpoint does not exist.
    • Timeout or connection refused errors suggest network issues or incorrect base URL.

Resolving these usually involves verifying credentials, endpoint availability, and correctness of input parameters.

Links and References

Discussion