Actions15
Overview
The Docker node with the Container resource and Run operation allows you to execute a command inside a new Docker container. This is useful for automating tasks that require isolated environments, such as running scripts, testing code, or processing files in a controlled setting. For example, you could use this node to run a Python script in a specific image, perform data transformations, or execute CLI tools without installing them on your host system.
Properties
Name | Meaning |
---|---|
Image | The name of the Docker image to use for creating the container (e.g., alpine , python:3.9 ). |
Command | A JSON array representing the command and its arguments to execute inside the container. Example: ["echo", "Hello World"] |
Output
The output contains the result of the executed command in the container:
{
"stdout": "<Standard output from the command>",
"stderr": "<Standard error output from the command>"
}
- stdout: Captures everything written to standard output by the command.
- stderr: Captures everything written to standard error by the command.
No binary data is produced by this operation.
Dependencies
- Docker Daemon: The node requires access to a Docker daemon (local or remote).
- Credentials: You must configure Docker credentials (
dockerCredentialsApi
) in n8n for the node to connect to Docker.
Troubleshooting
"No credentials got returned!"
This error occurs if Docker credentials are not configured or selected. Ensure you have set up the required credentials in n8n."Command must be an array!"
The Command property must be a valid JSON array. For example:["ls", "-la"]
. If you provide a string or invalid JSON, this error will appear.Image Pull Failures
If the specified image does not exist or there are network issues, pulling the image may fail. Make sure the image name is correct and the Docker daemon can access the registry.Permission Issues
The user running n8n must have permission to communicate with the Docker daemon.