Docker icon

Docker

Interact with Docker

Actions15

Overview

This node allows you to interact with Docker, specifically enabling you to run Docker containers programmatically. For the Network resource with the Run operation, it runs a Docker container based on a specified image and command.

Common scenarios include:

  • Automating containerized tasks by running specific Docker images with custom commands.
  • Integrating Docker container execution into workflows for CI/CD pipelines, testing, or batch processing.
  • Running network-related Docker containers dynamically as part of infrastructure automation.

Example: Running a network utility container (e.g., alpine image) with a command like ["ping", "google.com"] to check connectivity within a workflow.

Properties

Name Meaning
Image The Docker image name to run (e.g., "alpine", "nginx").
Command The command to execute inside the container, provided as a JSON array of strings.

Output

The node outputs an array of JSON objects representing the result of running the Docker container. Each output item contains:

  • stdout: The standard output captured from the container's execution.
  • stderr: The standard error output captured from the container's execution.

No binary data is output by this node.

Dependencies

  • Requires a valid Docker API connection configured via credentials that provide access to a Docker daemon.
  • The node uses the Dockerode library internally to communicate with Docker.
  • The Docker daemon must be accessible from where n8n is running.

Troubleshooting

  • Error: "No credentials got returned!"
    This indicates missing or misconfigured Docker API credentials. Ensure the Docker credential is properly set up in n8n.

  • Error: "Command must be an array!"
    The Command property must be a valid JSON array of strings. Check that the input is correctly formatted JSON representing an array.

  • Docker pull failures or container run errors
    These may occur if the specified image does not exist or there are network issues pulling the image. Verify the image name and Docker daemon connectivity.

  • Permission issues connecting to Docker daemon
    Make sure the user running n8n has permission to access the Docker socket or API endpoint.

Links and References

Discussion