Build Docker image

Buddy lets developers build Docker images with code from a Git repository and the selected Dockerfile. Setting up a Docker-focused pipeline is as easy as setting up any other type of delivery in the service.

Configuration

  1. First, you need to specify which repository should the image be based on. Buddy has native integrations with GitHub, Bitbucket and GitLab, but you can hook up any other repository as well:

Image loading...Selecting repository

  1. With the repository successfully synchronized, you can add the pipeline:

Image loading...Adding new pipeline

After creating the pipeline, you can configure when it should run by setting up triggers in the workflow. You can trigger pipelines on Git push events, webhooks, scheduled intervals, or manually. Learn how to configure pipeline triggers.

Image loading...Pipeline configuration

  1. With the pipeline prepared, we can add the Build Image from the Docker section of the action roster:

Image loading...Adding Build Docker image action

  1. In the action configuration, you can specify:
  • Pull required images or push image after built: Enable private registry authentication
  • Build Dockerfile: Path to your Dockerfile (default: Dockerfile)
  • Context: Directory containing the build context (default: /)
  • Build arguments: Add build-time arguments using the + button
  • Secrets: Add secrets for the build process using the + button
  • Options: Configure additional build options (e.g., "Always attempt to pull a newer version of the image")
  • Push image to registry: Enable automatic push after building

Image loading...Configuring Docker build details

Building private images

If the image is private (e.g. FROM: my-registry.com/buddy/my-image:latest) and requires logging into a registry, you can configure the integration in the Build tab in the action.

Buddy natively integrates with Docker Hub, Amazon ECR, Google GCR, GitHub Container Registry, Google Artifact Registry, and other registries. You can also use any other private registry:

Image loading...Selecting Docker registry

Building Multi-Arch Docker images

The Multi-Arch Build Image action allows you to set the target architecture for which the Docker image is built:

  • linux/amd64
  • linux/arm64
  • linux/arm/v7
  • linux/arm/v6

To choose the platform, add the action to the pipeline and select the desired architectures in the Platform section:

Image loading...Choosing target platform for multi-arch Docker images

Docker image Continuous Delivery

With Buddy, you can automate basically any type of DevOps process. For example, you can create a pipeline that will perform the following tasks on every push to the selected branch – just by adding new actions to the already existing ones:

  1. Run unit tests
  2. Check the Dockerfile for issues
  3. Build a Docker image
  4. Run the image and test it for errors
  5. Push the image to the selected registry
  6. Send a notification to a Slack channel

Here's how these tasks look like transferred into pipeline actions:

Image loading...Docker pipeline example

Tip
Buddy caches Docker layers and application dependencies to speed up your build process.

Build arguments

By default, Buddy doesn't pass the environment variables to the build. If you want to pass them, you have to define build args and provide the environment variable that you want to pass as a value.

Apart from this, you can define your own build arguments in the action:

Image loading...Build arguments

Target build stage

If your Dockerfile contains multiple build stages, you can specify which stage should be built using the --target option. This will skip all commands after the target stage. You can configure this in the Options section:

Image loading...Target build stage

Provenance

In the Build Docker image action, you can enable the creation of provenance attestations. These attestations encompass essential data, such as build timestamps, build parameters and environment configurations, version control metadata, and source code details. To utilize the feature, add the option in the Options section and select the desired mode from the dropdown:

Image loading...Provenance settings

Secrets

Buddy allows you to add secrets that are passed to a Docker build. Click the + button in the Secrets section to choose from two methods:

  • Add secret with variable as source: Use an environment variable as the source for your secret
  • Add secret with file as source: Use a file from the filesystem as the source for your secret

Image loading...Secrets

Cache

All Docker layers are automatically cached during the build process. This caching mechanism ensures that future builds only create layers that have been modified since the last build, which drastically reduces the build time.

You can configure additional cache-related settings by adding options in the Options section:

  • Always attempt to pull a newer version of the image: This option ensures that Buddy always tries to pull the latest version of base images before building
  • Prune dangling images: While it is possible to prune dangling images, we do not recommend doing so as it may slow down subsequent builds

Image loading...Cache options

Hint

📚 Learn more about Build Docker image action features, integrations and alternatives.

YAML i API

Last modified on Oct 29, 2025

Recommended