Docker icon

Docker

Interact with Docker

Actions15

Overview

This node allows interaction with Docker through three main operations: Get, List, and Run. Specifically, the Get Container operation retrieves detailed information about a specific Docker container by its ID. This is useful for scenarios where you need to inspect container status, configuration, or metadata programmatically within an n8n workflow.

Practical examples include:

  • Fetching the current state of a container before deciding to stop or restart it.
  • Retrieving container details to log or audit running services.
  • Integrating Docker container data into broader automation workflows.

Properties

Name Meaning
ID The unique identifier of the Docker container to retrieve information about.

Output

The node outputs JSON data representing the Docker container's details as returned by the Docker API. This typically includes container configuration, state, network settings, mounts, and other metadata.

If the operation was "Run" (not applicable here), the node would also handle stdout and stderr streams from the container execution, but for the "Get Container" operation, only JSON metadata is returned.

Dependencies

  • Requires a valid Docker API credential to connect to the Docker daemon.
  • Depends on the dockerode Node.js library for Docker API interactions.
  • The node expects the Docker environment to be accessible from where n8n runs (e.g., local Docker socket or remote Docker host).

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Docker API credentials. Ensure that the required API authentication token or connection details are properly set in n8n credentials.

  • Invalid container ID or container not found
    If the provided container ID does not exist or is incorrect, the Docker API will return an error. Verify the container ID is correct and that the Docker daemon is accessible.

  • Command must be an array!
    Although not relevant for the "Get" operation, this error can occur if using the "Run" operation with an invalid command format.

  • Connection issues with Docker daemon
    Network or permission problems may prevent connecting to Docker. Confirm that n8n has access rights and network connectivity to the Docker host.

Links and References

Discussion