Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • See all Red Hat products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Red Hat OpenShift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • See all technologies
    • Programming languages & frameworks

      • Java
      • Python
      • JavaScript
    • System design & architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer experience

      • Productivity
      • Tools
      • GitOps
    • Automated data processing

      • AI/ML
      • Data science
      • Apache Kafka on Kubernetes
    • Platform engineering

      • DevOps
      • DevSecOps
      • Red Hat Ansible Automation Platform for applications and services
    • Secure development & architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & cloud native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • See all learning resources

    E-books

    • GitOps cookbook
    • Podman in action
    • Kubernetes operators
    • The path to GitOps
    • See all e-books

    Cheat sheets

    • Linux commands
    • Bash commands
    • Git
    • systemd commands
    • See all cheat sheets

    Documentation

    • Product documentation
    • API catalog
    • Legacy documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore the Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Migrate BuildConfig resources to Builds for Red Hat OpenShift with Crane

Automate your migration with Crane

January 27, 2026
Prateek Singh Rathore
Related topics:
Application modernizationContainersOpen source
Related products:
Developer ToolsRed Hat OpenShift

    For years, OpenShift BuildConfig has been the standard way to build container images directly on Red Hat OpenShift clusters. Now, new build tools are available as the cloud-native ecosystem changes.

    Builds for Red Hat OpenShift is Red Hat's extensible framework for building container images on OpenShift. It is based on the open source project Shipwright, which provides a vendor-neutral framework for building container images on Kubernetes.

    Built on top of OpenShift Pipelines (Tekton), Builds for Red Hat OpenShift offers a flexible way to build containers with enterprise support from Red Hat.

    Today, we are announcing a developer preview for migrating from OpenShift BuildConfig resources to Builds for Red Hat OpenShift using Crane. This new upstream capability in Crane enables you to automatically convert your existing OpenShift BuildConfig resources to Builds for Red Hat OpenShift resources.

    What is Crane?

    Crane is an open source migration tool from the Konveyor community. It helps application owners migrate Kubernetes workloads and their state between clusters using an Extract, Transform, and Apply framework.

    This new BuildConfig conversion capability adds to the Crane migration toolkit to help organizations modernize their container build infrastructure.

    Developer preview notice

    This BuildConfig migration feature is available as an upstream community capability in Crane. It is not yet included in official Red Hat product offerings. As a developer preview, it is intended for evaluation and feedback purposes and is not supported for production use.

    What gets migrated?

    Crane automatically converts your BuildConfig resources to Builds for Red Hat OpenShift. Here's what's supported.

    Build strategies

    Crane converts Docker strategy BuildConfig resources to the Buildah ClusterBuildStrategy. It also converts Source strategy BuildConfig resources to use Source-to-Image ClusterBuildStrategy.

    Source types

    The tool handles all major source types:

    • Git sources: Full support for repository URL, branch and tag references, and clone secrets.
    • Binary sources: Converted to Local source type with streaming support.
    • Image sources: Converted to OCI artifact sources for image-based builds.

    Key features migrated

    Crane migrates these configuration settings from your BuildConfig to the new Builds for Red Hat OpenShift format:

    • Environment variables: These transfer automatically to the Build specification.
    • Build arguments: Docker build arguments are converted to ParamValues.
    • Dockerfile paths: Custom Dockerfile locations are preserved.
    • Git proxy configuration: HTTP/HTTPS proxy settings are converted to environment variables.
    • Source secrets: Clone secrets for private Git repositories.
    • Push secrets: Registry authentication for pushing images.
    • Context directories: Build context paths are maintained.

    How it works

    The migration process follows the following workflow:

    1. Discovery: Crane connects to your cluster and lists all BuildConfig resources in the specified namespace.
    2. Analysis: Each BuildConfig is analyzed for its strategy type, source configuration, and output settings.
    3. Validation: Pull secrets are validated to ensure they contain the required credentials.
    4. Conversion: Resources are mapped to their Builds for Red Hat OpenShift equivalents.

    Getting started: Migrating a BuildConfig with Docker strategy and Git source

    Ready to try the developer preview? This sections explains how to get started, walking through a complete migration example step by step.

    Prerequisites

    You will need the following installed on your cluster:

    • Red Hat OpenShift Pipelines
    • Builds for Red Hat OpenShift

    Step 1: Create the BuildConfig

    Let's look at an example BuildConfig (ruby_docker_git_buildconfig.yaml):

    • spec.source uses the Git type and defines a GitHub URI and branch. It also defines context directory, inline Dockerfile, secrets, and ConfigMap resources available in the builder pod.
    • spec.strategy uses the Docker type and defines a from image that overrides the builder image in the project's Dockerfile. It also defines a pull secret to pull images from a private registry, flags (noCache, forcePull, imageOptimizationPolicy), volumes, environment variables, and build arguments.

    Note

    The git.uri field should point to the Git repository containing your application source code. This example uses https://github.com/psrvere/ruby-hello-world as a sample for demonstration purposes.

     

    The from field refers to a private registry image, quay.io/prathore/ruby-27:latest, which requires a pullSecret for authentication. When using your own BuildConfig, replace this with your own image and secret, or use a public image and remove the pullSecret field.

    apiVersion: build.openshift.io/v1
    kind: BuildConfig
    metadata:
      name: ruby-docker-git
      namespace: default
    spec:
      source:
        type: Git
        git:
          ref: interim
          uri: https://github.com/psrvere/ruby-hello-world
        contextDir: .
        dockerfile: |
          FROM ruby:2.7
          WORKDIR /app
          COPY . .
          RUN bundle install
          EXPOSE 4567
          CMD ["ruby", "app.rb"]
        secrets:
          - secret:
              name: database-credentials
            destinationDir: config
        configMaps:
          - configMap:
              name: app-config
            destinationDir: config
      strategy:
        type: Docker
        dockerStrategy:
          from:
            kind: DockerImage
            name: quay.io/prathore/ruby-27:latest
          pullSecret:
            name: registry-creds
          noCache: true
          env:
            - name: RACK_ENV
              value: production
          forcePull: true
          dockerfilePath: ./dockerfilelocation/Dockerfile
          buildArgs:
            - name: BUILD_VERSION
              value: 1.0.0
          imageOptimizationPolicy: SkipLayers
          volumes:
            - name: bundler-config
              source:
                type: Secret
                secret:
                  secretName: bundler-secret
              mounts:
                - destinationPath: /workspace/Gemfile.lock

    Step 2: Validate the BuildConfig

    Make sure the BuildConfig is valid and runs correctly. Ensure secrets and ConfigMap resources are available in the cluster.

    oc create imagestream ruby-docker-git
    oc apply -f ruby_docker_git_buildconfig.yaml
    oc start-build ruby-docker-git
    oc get build

    Step 3: Download Crane CLI

    Download the latest crane CLI tool by running the following command:

    curl -fsSL https://raw.githubusercontent.com/psrvere/download-crane/main/download-crane.sh | bash

    This script automatically detects your platform and downloads the appropriate Crane binary.

    Alternatively, you can manually download the binary for your platform from the Crane Releases page.

    Step 4: Run the migration

    Run the migration with the following command:

    crane convert -r BuildConfigs -n default

    Flags:

    • -r BuildConfigs: Required for BuildConfig migration
    • -n default: Specifies the namespace (mandatory)

    The Crane CLI tool finds all BuildConfig resources in the namespace and migrates them to the Builds for Red Hat OpenShift format.

    Output directories:

    • ./convert/buildconfigs/<namespace>/: All extracted BuildConfig resources.
    • ./convert/builds/<namespace>/: All migrated Build resources and supporting files.

    You will see detailed logs for each BuildConfig. Here's an example output:

    INFO Converting BuildConfigs in namespace: default 
    INFO Found 1 BuildConfig to convert              
    INFO -------------------------------------------------------- 
    INFO Processing BuildConfig: ruby-docker-git at index 0 
    INFO -------------------------------------------------------- 
    INFO Docker strategy detected                     
    WARN From Field in BuildConfig's Docker strategy is not yet supported in built-in Buildah ClusterBuildStrategy in Shipwright. RFE: https://issues.redhat.com/browse/BUILD-1746 
    WARN NoCache flag is not yet supported in the built-in Buildah ClusterBuildStrategy in Shipwright. RFE: https://issues.redhat.com/browse/BUILD-1578 
    INFO Processing Environment Variables             
    WARN ForcePull flag is not yet supported in the built-in Buildah ClusterBuildStrategy in Shipwright. RFE: https://issues.redhat.com/browse/BUILD-1580 
    INFO Processing Dockerfile path                   
    INFO Processing Build Args                        
    WARN ImageOptimizationPolicy (--squash) flag is not yet supported in the built-in Buildah ClusterBuildStrategy in Shipwright. RFE: https://issues.redhat.com/browse/BUILD-1581 
    WARN Unlike BuildConfig, Volumes have to be supported in the Buildah Strategy first in Shipwright. Please raise your requirements here: https://issues.redhat.com/browse/BUILD-1747 
    ERRO Inline Dockerfile is not supported in buildah strategy. Consider moving it to a separate file. 
    INFO Processing Git Source                        
    INFO Processing Git CloneSecret                   
    WARN ConfigMaps are not yet supported in Shipwright build environment. RFE: https://issues.redhat.com/browse/BUILD-1745 
    WARN Secrets are not yet supported in Shipwright build environment. RFE: https://issues.redhat.com/browse/BUILD-1744 
    WARN Push to Openshift ImageStreams is not yet supported in Shipwright. RFE: https://issues.redhat.com/browse/BUILD-1756

    Understanding the logs:

    • INFO: Successfully migrated fields
    • WARN: Feature not yet supported but on the roadmap (includes RFE links)
    • ERRO: Feature not planned for support

    In the generated OpenShift Build file, the Build resource defines a ClusterBuildStrategy (Buildah), a Git source with URL and branch, environment variables, build arguments, a custom Dockerfile location, and an output registry:

    apiVersion: shipwright.io/v1beta1
    kind: Build
    metadata:
      creationTimestamp: "2025-12-16T11:17:37Z"
      name: ruby-docker-git
      namespace: default
    spec:
      env:
        - name: RACK_ENV
          value: production
      output:
        image: image-registry.openshift-image-registry.svc:5000/default/ruby-docker-git:latest
      paramValues:
        - name: dockerfile
          value: dockerfilelocation/Dockerfile
        - name: build-args
          values:
            - value: BUILD_VERSION=1.0.0
      source:
        git:
          revision: interim
          url: https://github.com/psrvere/ruby-hello-world
        type: Git
      strategy:
        kind: ClusterBuildStrategy
        name: buildah

    Step 5: Run the generated build

    Review and modify if needed. First, check if you need to modify the generated files. In our case, we might need to change the output image. Although ImageStreams have been migrated to a correct URL in the generated file, this feature is not fully supported yet (see warnings).

    You can change the output image to use any public registry.

    Create a BuildRun resource (ruby_docker_buildrun.yaml):

    apiVersion: shipwright.io/v1beta1
    kind: BuildRun
    metadata:
      name: ruby-docker-buildrun
      namespace: default
    spec:
      build:
        name: ruby-docker-git
      serviceAccount: ruby-docker-git

    Run the BuildRun:

    oc apply -f ruby_docker_buildrun.yaml
    oc get buildrun

    You can also view a video demo.

    Current availability and support

    This migration tool is currently available as an upstream developer preview in the Crane project.

    This feature is not yet included in official Red Hat product offerings. We encourage you to try the developer preview and share your feedback as we work toward broader availability.

    If you have questions or issues, open an issue on the Crane GitHub repository.

    Related Posts

    • Project Shipwright and the future of Red Hat OpenShift builds

    • Apply generative AI to app modernization with Konveyor AI

    • Install RHEL packages in container images using Shipwright

    • Shipwright: A framework for building container images on Kubernetes

    • Build on multi-arch clusters with builds for Red Hat OpenShift

    Recent Posts

    • Migrate BuildConfig resources to Builds for Red Hat OpenShift with Crane

    • How to install Red Hat Developer Hub

    • Understanding the recommender system's two-tower model

    • AI quickstart: Self-service agent for IT process automation

    • Security Data API: How to retrieve CVE data with curl and jq

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue