Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker images, specifically allowing users to create new tags for existing Docker images. Tagging an image is useful when you want to assign a new identifier (tag) to an image, for example, to mark a specific version or variant of the image.

Common scenarios include:

  • Organizing images by tagging them with version numbers or environment labels (e.g., v1.0, latest, staging).
  • Preparing images for pushing to different repositories or registries.
  • Managing image lifecycle and deployment workflows by tagging images appropriately.

Practical example:

  • You have a Docker image with ID abc123def456 and want to tag it as myrepo/myapp:stable. Using this node, you specify the repository as myrepo/myapp and the new tag as stable to create this tag on the image.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the Docker image resides.
Image ID The unique identifier of the Docker image to be tagged.
Repository The name of the repository to which the new tag will be applied.
New Tag The new tag string to assign to the image (e.g., latest, v1.0, stable).

Output

The node outputs JSON data representing the response from the Portainer API after tagging the image. This typically includes confirmation of the tagging operation but does not return the full image details.

No binary data output is involved in this operation.

Dependencies

  • Requires a valid connection to a Portainer instance with API access.
  • An API key credential must be configured in n8n to authenticate requests to the Portainer API.
  • The Portainer API base URL and API key are used to make authenticated HTTP POST requests.

Troubleshooting

  • Invalid Environment ID or Image ID: If the environment or image ID is incorrect or does not exist, the API will return an error. Verify that the IDs correspond to existing resources in your Portainer setup.
  • Insufficient Permissions: Ensure the API key used has sufficient permissions to tag images.
  • Network Issues: Connectivity problems between n8n and the Portainer server can cause request failures.
  • Incorrect Repository or Tag Format: The repository and tag should follow Docker naming conventions; invalid names may cause errors.

If an error occurs, check the error message returned by the Portainer API for details and verify all input parameters.

Links and References

Discussion