Build Configuration

7 min read

Build Configuration #

Overview

Once a service is created and an environment is associated with it, the platform team can configure CI build settings through the BuildPiper UI. This guide covers the four CI configuration segments: Source Code, Advanced Settings, Variables, and Hooks.

All four configuration segments can also be managed through the BPCTL CLI, providing users with the flexibility to configure CI builds using either the UI or the command line.

Swipe horizontally to view all columns →
Capability Description
Service-Linked CI Build configuration is tied to a service and its environment, ensuring each environment can have its own CI settings if required.
UI-Driven Setup All CI configurations are managed through the BuildPiper UI, allowing platform teams to configure builds without manually editing pipeline files.

1. CI Configuration Segments #

There are four segments of settings for the CI, each covered in its own section below.

Swipe horizontally to view all columns →
No. Segment Description
01 Source Code Details Repository, branch, build context and Dockerfile path settings.
02 Advanced Configurations Specialised settings for cloning, multi-arch builds, shallow cloning and provenance.
03 CI Variables Build environment variables and image labels for runtime configuration.
04 Hook Configurations Pre-hooks and post-hooks for custom script execution around builds.

2. Source Code Details #

These settings tell BuildPiper where to fetch your source code from and how Docker should build the image.

Swipe horizontally to view all columns →
Field Name Mandatory Description
Git URL Yes Select repository from the drop-down.
Branch No Click on the Load Branch button to select the required branch name.
Build Context Yes The directory (and its contents) that Docker uses during the build. It is typically the root of your repository or a specific subfolder.
Dockerfile Path Yes Relative path to the Dockerfile with reference to the build context.

Build context example #

BASH BASH
Command
docker build -t myapp .

The trailing dot (.) is the build context — the base location where this command runs.

3. Advanced Settings #

Advanced settings are configurations that are not enabled by default. They are activated for specific use cases and are controlled through BP system settings.

Note: Each advanced setting must be explicitly enabled under System Settings → Build System & CI Configuration before it appears in the build configuration UI.

Swipe horizontally to view all columns →
Field Name Description
Clone configurations from an external source A specialized case where the base repository contains external dependencies that also need to be cloned in order to build the service. Examples include Git submodules and similar dependency-based setups.
Select Platform By default, BuildPiper performs builds for AMD architecture. Users can configure other supported architectures, such as ARM. For instructions, refer to the How to Enable Multi-Arch Builds guide.
Shallow Cloning Optimizes build performance by fetching only the latest commits up to a specified depth, rather than the entire Git history. This reduces repository cloning time and storage usage. Shallow cloning is enabled by default. To enable or configure this feature, refer to System Settings → Build System & CI Configuration.
Provenance Attestations Automatically generates and attaches a “build proof” to every container image. The proof contains source provenance and build metadata, verifying that the image is trustworthy and traceable. When enabled, BP appends –provenance=true to the Dockerfile build command.

3.1 Inspecting Provenance Attestations #

After pushing the image, you can inspect the provenance information without pulling the full image by using the docker Buildx image tools command.

BASH BASH
Command
docker buildx imagetools inspect my-app:latest --format "{{json .Provenance}}"

Example output (SLSA provenance): #

JSON JSON
JSON Output
{
  "SLSA": {
    "buildType": "https://mobyproject.org/buildkit@v1",
    "invocation": {
      "configSource": { "entryPoint": "Dockerfile" },
      "environment": { "platform": "linux/amd64" }
    },
    "materials": [{
      "digest": { "sha256": "8b1e78743a03dbb2c95171cc58..." },
      "uri": "pkg:docker/nginx@alpine?platform=linux%2Famd64"
    }],
    "metadata": {
      "buildStartedOn": "2026-05-26T15:29:42.923Z",
      "buildFinishedOn": "2026-05-26T15:29:49.530Z",
      "buildInvocationID": "jay7isrli44btwoo832n10n29",
      "reproducible": false
    }
  }
}

This output is the SLSA provenance attestation embedded by Docker Buildx/BuildKit for the image registry.buildpiper.in/ot-light:15.

4. CI Variables #

Configure environment variables and metadata labels that influence build and runtime behavior.

Swipe horizontally to view all columns →
Field Name Description
Build Env Details Define dynamic values that are passed to the image build process, allowing users to customize build configurations, software versions, or feature flags without hardcoding them. These arguments can influence how an image is built but do not automatically make the same image behave differently across environments at runtime. This option is disabled by default.
Build Labels Custom metadata/labels added to the generated image — informational stickers (version, maintainer, environment, build details) stored inside the image itself. This option is disabled by default.
Provide Runtime Environment Variables Enable this option to pass key-value pairs to the container at runtime, allowing you to configure application behavior without modifying the image. This option is disabled by default. When enabled, you can add environment variables by specifying a key and selecting or providing its value.

4.1 Build Env Details — Examples #

Defining environment variables in the Dockerfile:

BASH BASH
Dockerfile
ENV APP_ENV=production
ENV PORT=8080

Or passing variables at runtime:

BASH BASH
Command
docker run -e APP_ENV=staging -e PORT=3000 myapp

4.2 Build Labels — Inspecting #

Fetch the labels embedded in an image:

BASH BASH
Command
docker inspect --format='{{.Config.Labels}}' myimage

Sample output:

JSON JSON
JSON Output
{
  "Config": {
    "Labels": {
      "version": "1.0",
      "maintainer": "team@company.com"
    }
  }
}

5. CI Hooks #

BuildPiper provides the ability to set up custom pre-hooks and post-hooks during the build information stage, enabling the execution of custom steps before and after the creation of the Docker image.

Swipe horizontally to view all columns →
Field Name Description
Pre / Post Hooks Enable this configuration to execute custom scripts or commands at specific stages of the build process. Pre-hooks execute before the Docker image is created, while post-hooks execute after the image is created.

⚠️ Warning: Pre-hooks and post-hooks allow custom script execution and should be configured with utmost caution. Grant access to these settings only to authorized and trusted users, as malicious or improperly configured scripts may introduce security vulnerabilities, disrupt build processes, or affect system stability.Pre-hooks and post-hooks can be added via the three options offered by BuildPiper:

Swipe horizontally to view all columns →
Option Description
A. Via Command Run a Command directly inside the build environment.
B. Via File Upload Upload a script file and enter the command arguments.
C. Via Git Select the Git URL, branch, file/folder path and enter command arguments.

6. Navigation #

Build Configuration screenshot 1

Figure 1: Navigation to Configure Build Details

  1. 1

    Log in to BuildPiper.

  2. 2

    Switch to User Portal.

  3. 3

    Click Application.

  4. 4

    Open Service Overview.

  5. 5

    Select the service name.

  6. 6

    Click CONFIGURE BUILD.

Note: The BP Environment onboarding page is accessible inside the User Portal.

7. BP Snapshots #

Reference screenshots showing each stage of the CI configuration flow inside BuildPiper.

Build Configuration screenshot 2

Figure 2: Configuring build for a service — CI Source Details

Build Configuration screenshot 3

Figure 3: Configuring build for a service — CI Env Variables

Build Configuration screenshot 4

Figure 4: Configuring build for a service — CI Hooks (pre and post)

Build Configuration screenshot 5

Figure 5: CI configurations being saved in the UI

8. Secondary Build #

A Secondary Build is an additional build job that runs in parallel with the primary build. It is triggered by the same event, but it is independent in every other way. It has its own settings, such as source, environment variables and hooks, and it produces its own image. If the secondary build fails, the main build is not affected.

Use a secondary build when you need more than one artifact from a single build execution, for example, different Dockerfiles or image names for different deployment needs. An example could be building the init container build along with the main workload container build.

Build Configuration screenshot 6

Figure 6: Configure Secondary Build

  1. 1

    Open the service and go to the ENV BUILD DETAILS page.

  2. 2

    Click CONFIGURE SECONDARY BUILD, below the Main Build.

  3. 3

    Complete the four steps: Source Details, Env Variable, Hooks and Promote Configuration.

Build Configuration screenshot 7

Figure 7: Secondary Build — Source Details

Once configured, the secondary build appears below the Main Build on the ENV BUILD DETAILS page. The secondary build will always happen along with the main build. The image name will be the same, with an additional suffix of the secondary build name.

Build Configuration screenshot 8

Figure 8: Secondary Build configured