Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

The node integrates with the Portainer API to manage Docker images, specifically supporting the "Push" operation for images. This operation allows users to push a Docker image from a specified environment (endpoint) to a container registry.

Common scenarios where this node is beneficial include:

  • Automating Docker image deployment pipelines by pushing newly built or tagged images to registries.
  • Managing Docker images across multiple environments/endpoints programmatically.
  • Integrating Docker image management into broader workflows within n8n.

Practical example:

  • After building a Docker image in a CI/CD pipeline, use this node to push the image with a specific tag to a Docker registry, making it available for deployment on other systems.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the image resides.
Image ID The unique identifier of the Docker image to be pushed.
Image Tag The tag of the image to push (e.g., "latest"). Defaults to "latest".

Output

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

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a Portainer instance with API access.
  • Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
  • The Portainer environment/endpoint must be accessible and properly configured to allow image push operations.

Troubleshooting

  • Common issues:

    • Invalid or missing Environment ID or Image ID parameters will cause the request to fail.
    • Insufficient permissions or invalid API key may result in authentication errors.
    • Network connectivity problems between n8n and the Portainer endpoint can prevent successful API calls.
    • Incorrect image tag might lead to pushing the wrong image version or failure if the tag does not exist.
  • Error messages and resolutions:

    • 401 Unauthorized: Check that the API key credential is correct and has sufficient permissions.
    • 404 Not Found: Verify that the Environment ID and Image ID correspond to existing resources in Portainer.
    • 500 Internal Server Error: Could indicate server-side issues; retry later or check Portainer logs.
    • 400 Bad Request: Ensure all required parameters are provided and correctly formatted.

Links and References

Discussion