Actions72
- Image Actions
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Stack Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Overview
This node integrates with the Portainer API to manage Docker resources programmatically. Specifically, for the Image resource with the Build operation, it allows users to build a Docker image from a Dockerfile context by sending a tar archive of the build context to the Portainer-managed Docker environment.
Common scenarios where this node is beneficial include:
- Automating Docker image builds as part of CI/CD pipelines.
- Building custom Docker images remotely on a Docker host managed by Portainer.
- Integrating Docker image build steps into broader workflow automations without manual CLI interaction.
Practical example:
- You have a Dockerfile and application source code packaged as a tar archive. Using this node, you can send that archive to your remote Docker environment via Portainer to build an image tagged as
myapp:latest.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the Portainer environment/endpoint where the Docker image will be built. |
| Image Tag | The tag to assign to the built Docker image (e.g., "latest", "v1.0"). |
Output
The node outputs the JSON response returned by the Portainer API after attempting to build the Docker image. This typically includes details about the build process, success status, and any messages or errors from the Docker daemon.
No binary data output is produced by this operation.
Dependencies
Requires a configured Portainer API authentication credential containing:
- Base URL of the Portainer instance.
- An API key/token for authorization.
The node sends HTTP POST requests to the Portainer API endpoint
/endpoints/{environmentId}/docker/build.The build context must be provided as a tar archive in the request body with content type
application/x-tar.
Troubleshooting
Common issues:
- Incorrect or missing Environment ID may cause the API call to fail due to invalid endpoint reference.
- Providing an invalid or malformed tar archive as the build context will result in build failure.
- Insufficient permissions or invalid API key will cause authorization errors.
- Specifying a non-existent Dockerfile name (other than default "Dockerfile") may cause the build to fail.
Error messages:
- Authorization errors: Check that the API key credential is valid and has sufficient permissions.
- 404 Not Found: Verify the Environment ID corresponds to an existing Portainer endpoint.
- Build errors: Review the Docker build logs returned in the response for syntax or context issues.