Portainer icon

Portainer

Work with Portainer API data to manage Docker

Image → Build

AI-generated

Overview

This node operation allows users to build a Docker image from a Dockerfile using the Portainer API. It is useful for automating the process of creating Docker images within a CI/CD pipeline or container management workflow. For example, a user can specify the environment ID, image tag, and provide the build context (tar archive of the Dockerfile and related files) to build a new image programmatically.

Use Case Examples

  1. Building a custom Docker image from a Dockerfile stored in a repository or local context.
  2. Automating image builds as part of a deployment pipeline to ensure the latest application version is containerized.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the image will be built.
Image Tag The tag to assign to the built image, e.g., 'latest'.
Request Options Additional request options such as batching, SSL certificate validation, proxy settings, and timeout configuration.

Output

JSON

  • body - The response body from the Portainer API after building the image, typically containing build status or result information.

Dependencies

  • Portainer API with an API key credential for authentication

Troubleshooting

  • Ensure the environment ID is correct and accessible in Portainer to avoid authorization or connection errors.
  • Verify the build context is correctly formatted as a tar archive and includes a valid Dockerfile; otherwise, the build will fail.
  • Check that the image tag is valid and does not conflict with existing images unless overwriting is intended.
  • If SSL errors occur, consider enabling the 'Ignore SSL Issues' option if using self-signed certificates.

Links

Discussion