Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows users to create a Docker volume through the Portainer API. It is useful in scenarios where you want to programmatically manage Docker volumes, such as automating container storage setup or integrating volume creation into CI/CD pipelines. For example, you can use this node to create persistent storage volumes before deploying containers that require data persistence.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint to connect to via the Portainer API. You can select from a list of available endpoints or specify an ID manually.
Volume Config A JSON string representing the configuration of the volume to be created. This should include all necessary volume parameters as expected by the Docker API.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to create the volume. This typically includes details about the newly created volume such as its name, driver, mount point, and other metadata. There is no binary output.

Dependencies

  • Requires access to a Portainer API instance.
  • Requires an API key credential for authenticating with the Portainer API.
  • The user must configure the base URL of the Portainer API and provide a valid endpoint ID.
  • The node depends on the Portainer API's /api/endpoints and /docker/volumes/create endpoints.

Troubleshooting

  • Invalid Endpoint ID: If the specified endpoint ID does not exist or is incorrect, the node will fail to connect. Verify the endpoint ID by using the dropdown or checking your Portainer setup.
  • Malformed Volume Config: The Volume Config property expects a valid JSON string. Errors will occur if the JSON is invalid or missing required fields. Validate the JSON format before running.
  • Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions to create volumes.
  • API Connectivity Issues: Check network connectivity to the Portainer API URL and ensure the API server is reachable.

Links and References

Discussion