Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows you to load Docker images into a specified Docker endpoint managed by Portainer via its API. It uploads a tarball archive containing one or more Docker images and imports them into the target Docker environment.

Common scenarios include:

  • Automating deployment pipelines where pre-built Docker images are loaded into remote Docker hosts.
  • Migrating or restoring Docker images between environments without pulling from a registry.
  • Bulk loading multiple images packaged as a tar archive.

For example, you might use this node to load a backup of Docker images stored as a tarball into a remote Docker host managed by Portainer, enabling quick setup of containers based on those images.

Properties

Name Meaning
EndpointID Name or ID The target Docker endpoint (host) managed by Portainer where the images will be loaded. You can select from a list of available endpoints or specify an ID directly.
Images Tarball The tar archive file containing the Docker images to load. This should be provided as a string representing the tarball content or path depending on usage context.
Additional Fields Optional parameters to customize the image loading process:
- Quiet Boolean flag to suppress progress details during the image load operation.
- Platform JSON string describing the OCI platform specification to select a platform-specific image when loading multi-platform images. Example: {"os": "linux", "architecture": "arm", "variant": "v5"}. If omitted, loads all platforms.

Output

The node outputs JSON data representing the response from the Portainer Docker API after attempting to load the images. This typically includes status information about the load operation, such as success confirmation or error details.

If the operation involves binary data (the tarball), it is sent in the request body but not outputted by the node.

Dependencies

  • Requires access to a Portainer instance with API enabled.
  • Needs an API authentication token or key configured in n8n credentials to authenticate requests to the Portainer API.
  • The node depends on the Portainer API's /api/endpoints/{endpointId}/docker/images/load endpoint to perform the image load operation.
  • The user must have appropriate permissions on the selected Docker endpoint to load images.

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the selected endpoint exists and is accessible.
    • Incorrect or malformed tarball: Verify the tar archive contains valid Docker images.
    • Authentication failures: Check that the API key/token credential is correctly configured and has sufficient permissions.
    • Platform specification errors: If using the platform option, ensure the JSON is well-formed and matches supported OCI platform formats.
  • Error messages:

    • HTTP 401 Unauthorized: Indicates invalid or missing API credentials.
    • HTTP 404 Not Found: The specified endpoint ID does not exist.
    • HTTP 400 Bad Request: Usually caused by invalid input parameters, such as malformed tarball or incorrect query parameters.

Resolving these generally involves verifying credentials, endpoint selection, and input data correctness.

Links and References

Discussion