Skip to main content

Build images without pushing

In Harness CI, you can build container images without pushing them. This is useful to validate your Dockerfile or check if the image builds successfully before pushing it to a registry.

The dry-run behavior depends on the image build tool used by your pipeline step — either Kaniko or Buildxnot on the infrastructure (Kubernetes, Harness Cloud, etc.).

Build tool behavior

Build ToolDry Run FlagNotes
KanikoPLUGIN_PUSH_ONLY=trueDefault on Kubernetes unless overridden by feature flag
BuildxPLUGIN_DRY_RUN=trueUsed when DLC checkbox is enabled or feature flag switches to Buildx

DLC checkbox: Enabling this forces usage of Buildx regardless of infrastructure.

Kubernetes users: You get Kaniko by default. If the Buildx feature flag is enabled, it switches to Buildx — even if the DLC checkbox is off.

Harness Cloud, Local Runner, or Self-managed VM

These environments use Buildx by default. Add PLUGIN_DRY_RUN=true to trigger a dry run.

For built-in Build and Push steps, add a STAGE variable:

  1. Go to the Build stage with the Build and Push step.
  2. In the Overview tab, expand the Advanced section.
  3. Add a variable:
    • Name: PLUGIN_DRY_RUN
    • Type: String
    • Value: true
  4. Save and run the pipeline.

Kubernetes Cluster Build Infrastructure

Kubernetes infra uses Kaniko by default. In this case, use the PLUGIN_PUSH_ONLY flag:

envVariables:
PLUGIN_PUSH_ONLY: true

If your org has enabled the Buildx feature flag (or if DLC is enabled), use:

envVariables:
PLUGIN_DRY_RUN: true