Skip to main content
In the OpenShift console, navigate to Builds → Build Configs and click Create BuildConfig to open the example form. This walkthrough shows how to configure a BuildConfig to build the Sock Shop application from source.
  1. In your Git repository browser click the Code button and copy the HTTPS URL for the repo you want to build.
  2. In the BuildConfig form, replace the example Git URI with your Sock Shop repo URL and set the BuildConfig name (for example sock-shop).
  3. Verify the Git branch (for example master or main) and choose the build strategy (commonly Source for S2I/source builds).
Example BuildConfig (trimmed to show the key fields to change):
Key BuildConfig fields The important piece that actually provides the build environment is the builder image referenced in spec.strategy.from (or other from locations). In OpenShift this commonly references an ImageStreamTag (for example nodejs:14 or s2i-ruby:2.7) — the builder image runs the build steps and produces the application image.
The BuildConfig ties your source repository to a builder image (ImageStreamTag). That’s why a BuildConfig takes your code and creates a container image by using another container image as the build environment.
After you save the BuildConfig, OpenShift will schedule the build automatically. Open the BuildConfig details in the console and check the Events or Builds tab to confirm the build started and to inspect any errors. Automating BuildConfig creation with oc new-app If you prefer the CLI, oc new-app can create an ImageStream, a BuildConfig, a Deployment (or DeploymentConfig), and a Service for you when you point it at a Git repository:
Typical oc new-app output:
If you refresh the console Build Configs page you will see the new BuildConfig (for example gowebapi) — demonstrating that OpenShift can create BuildConfigs automatically when creating an application from source.
If your Git repo is private, oc new-app or the BuildConfig will need credentials or a secret to access the repository. Make sure to create and reference the appropriate secret in spec.source before starting the build.
Manually starting or re-triggering a build Use oc start-build to manually start a build from a BuildConfig:
Stream build logs to monitor progress and diagnose problems:
Command summary Summary / Best practices
  • Create or edit a BuildConfig to point at your Git repo and choose an appropriate builder ImageStreamTag (the from image).
  • Use the console or oc commands (oc new-app, oc start-build, oc logs -f) to create, trigger, and monitor builds.
  • Check BuildConfig Events in the console to confirm success or view errors.
  • For private repos, add the necessary credentials/Secrets and reference them in the BuildConfig before starting builds.
For more details on BuildConfig and ImageStreams, refer to the OpenShift documentation and your cluster’s ImageStream catalog for available builder images.

Watch Video