Actions15
Overview
This node allows you to interact with Docker, specifically enabling you to run Docker containers based on a specified image and command. The "Run" operation for the "Volume" resource (and other resources) lets you start a container by pulling the specified Docker image and executing the given command inside it. This is useful for automating containerized tasks such as running scripts, batch jobs, or any containerized application directly from your workflow.
Practical examples include:
- Running a data processing script inside a container.
- Launching a temporary container to perform maintenance tasks.
- Automating testing environments by running test suites inside containers.
Properties
| Name | Meaning |
|---|---|
| Image | The name of the Docker image to pull and run. |
| Command | The command to execute inside the container, provided as a JSON array of strings. |
Output
The node outputs JSON data representing the result of the Docker container execution. Specifically, it returns an array of objects containing the combined standard output (stdout) and standard error (stderr) captured from the container run.
stdout: The textual output produced by the container's command.stderr: Any error messages or logs produced during execution.
No binary data output is indicated in this implementation.
Dependencies
- Requires a Docker environment accessible via API credentials configured in n8n.
- Needs an API key or authentication token to connect to the Docker daemon.
- Uses the
dockerodeNode.js library internally to communicate with Docker.
Troubleshooting
Error: "No credentials got returned!"
This indicates that the required Docker API credentials were not provided or could not be retrieved. Ensure that valid Docker credentials are configured in n8n.Error: "Command must be an array!"
The command property must be a JSON array of strings. Providing a different type (e.g., string or object) will cause this error. Make sure to input the command as a JSON array, e.g.,["ls", "-la"].Docker Pull Failures
If the node fails when pulling the Docker image, verify that the image name is correct and accessible from the Docker registry.Container Execution Issues
Errors during container run may stem from invalid commands or insufficient permissions. Check the command syntax and Docker daemon permissions.