Skip to main content

Build images without pushing

In Harness CI, you can build images without pushing them. For example, you can use your CI pipeline to test a Dockerfile from your codebase to verify that the resulting image is correct before you push it to your Docker repository.

The build dry run configuration depends on your build infrastructure and the step or plugin you use for your build.

Harness Cloud, local runner, or self-managed VM

Use these instructions for build dry runs on Harness Cloud, self-managed VM, or local runner build infrastructure.

For built-in Build and Push steps, you need to add a stage variable named PLUGIN_DRY_RUN.

  1. In your CI pipeline, go to the Build stage that includes a Build and Push step.
  2. In the Build stage's Overview tab, expand the Advanced section.
  3. Select Add Variable and enter the following:
    • Name: PLUGIN_DRY_RUN
    • Type: String
    • Value: true
  4. Save and run the pipeline.

Kubernetes cluster build infrastructure

Use these instructions for build dry runs on Kubernetes cluster build infrastructure.

For the built-in Build and Push steps, add the PLUGIN_NO_PUSH variable to the Build and Push step's Environment Variables.

                    envVariables:
PLUGIN_NO_PUSH: true