Docker icon

Docker

Interact with Docker

Actions15

Overview

This n8n node allows you to interact with Docker resources. Specifically, for the Volume resource and the List operation, the node retrieves a list of Docker volumes available on the connected Docker host. This is useful in automation scenarios where you need to audit, manage, or process information about Docker volumes as part of your workflow.

Practical examples:

  • Automatically inventory all Docker volumes before performing cleanup operations.
  • Integrate with monitoring tools to report on volume usage.
  • Trigger alerts if certain volumes are missing or have unexpected properties.

Properties

Name Meaning
Options Additional options for listing volumes, provided as a JSON object. Refer to Docker API for supported fields (e.g., filters).

Output

The output is a JSON array containing information about each Docker volume. Each item typically includes details such as:

{
  "Volumes": [
    {
      "Name": "volume_name",
      "Driver": "local",
      "Mountpoint": "/var/lib/docker/volumes/volume_name/_data",
      "Labels": {},
      "Scope": "local",
      // ...other Docker volume fields
    }
  ],
  "Warnings": []
}
  • Volumes: An array of objects, each representing a Docker volume and its properties.
  • Warnings: An array of warning messages, if any.

Dependencies

  • Docker Host: The node requires access to a Docker daemon.
  • Credentials: You must configure Docker credentials in n8n (dockerCredentialsApi).
  • External Library: Uses the dockerode npm package to communicate with Docker.

Troubleshooting

Common issues:

  • Missing Credentials:
    Error: No credentials got returned!
    Solution: Ensure that Docker credentials are properly configured in n8n.

  • Connection Errors:
    If the node cannot connect to the Docker daemon, check network connectivity and Docker daemon status.

  • Invalid Options JSON:
    If the Options property contains invalid JSON, the node may fail. Always provide valid JSON.

Links and References

Discussion