Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Using a custom builder image on Red Hat OpenShift with OpenShift Do

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

July 15, 2019
Daniel Helfand
Related topics:
ContainersDeveloper toolsGoKubernetes
Related products:
Red Hat OpenShift

    One of the things I enjoy most about using Red Hat OpenShift is the Developer Catalog. The Developer Catalog is a central location where a team working with Red Hat OpenShift can encapsulate and share how application components and services are deployed.

    The Developer Catalog is often used to define an infrastructure pattern referred to as a builder image. A builder image is a container image that supports a particular language or framework, following best practices and Source-to-Image (s2i) specifications.

    The OpenShift Developer Catalog provides several standard builder images supporting applications written in Node.js, Ruby, Python, and more. And while the Developer Catalog has many easy ways to get started deploying several supported languages, the catalog is also flexible in allowing you to add your own builder images to support an infrastructure pattern that is not preloaded in the catalog.

    Custom Builder Images

    One language that is currently not preloaded into the catalog is Golang. To add a Golang builder image, an imagestream can be used to define what container image to use to support a Golang component. An imagestream can be written in YAML or JSON to define properties of the builder image, including where to pull the image definition from and descriptions of the image that will display in the Developer Catalog web console.

    I used the imagestream found here to add Golang to a Red Hat OpenShift 4 Developer Catalog. The first property we are interested in defining as part of an imagestream is the kind property, which is used to specify that an imagestream is being created. We can also define a display name that will be available in the catalog through the web console.

    The main tags property of the imagestream definition can be used to define different versions of a builder image that are supported. Additionally, each version defined within the tags property can have its own tags where it can be specified the image is a builder image by including a builder tag.

    Using the from property, we can specify what image to use and where to pull the image from. In the Golang example, the image is pulled from DockerHub and is a Docker image.

    The final step in adding the Golang builder image is to log in to your Red Hat OpenShift cluster using oc login and then run the following:

    curl -kL https://gist.github.com/danielhelfand/6b63ba3f250ea596a077904d43abaf62/raw 2> /dev/null | oc apply -n openshift --as system:admin -f -

    With the command above, a Golang option has been added under the OpenShift namespace and will now be available to support Golang applications. Now that this builder image is available in the catalog, how can it quickly be utilized to deploy an application component and test that the image is able to support that component?

    Using OpenShift Do (odo), the developer-focused CLI for OpenShift, we can easily leverage builder images available in the Developer Catalog. To see what options are available, odo features a command to list builder images (i.e., components) available in the catalog:

    $ odo catalog list components
    
    NAME               PROJECT      TAGS
    dotnet             openshift    1.0,1.1,2.1,2.2,latest
    golang             openshift    1.10.2,latest
    httpd              openshift    2.4,latest
    java               openshift    8,latest
    modern-webapp      openshift    10.x,latest
    nginx              openshift    1.10,1.12,1.8,latest
    nodejs             openshift    10,6,8,8-RHOAR,latest
    perl               openshift    5.24,5.26,latest
    php                openshift    7.0,7.1,7.2,latest
    python             openshift    2.7,3.5,3.6,latest
    ruby               openshift    2.3,2.4,2.5,latest

    Using the OpenShift Golang example shown here, I can run the following to create a project in my OpenShift cluster, create a Golang component that will use the Golang builder image created via an imagestream, expose the component via a URL, and then deploy the component and have it running on OpenShift:

    # Clone the golang example application and go into its root directory
    $ git clone https://github.com/sclorg/golang-ex
    $ cd golang-ex
    
    # Create the configuration for the golang example application to be
    # deployed to OpeShift using odo and deploy it to OpenShift
    
    $ odo project create goproject
    $ odo create golang golang-ex --port 8080
    $ odo url create golang-ex --port 8080
    $ odo push

    When the deployment is complete, the Golang component can be accessed via the URL created by odo. Clicking on the URL should show the following greeting:

    >Hello OpenShift!

    Imagestreams make it easier to promote reuse of infrastructure patterns so development teams can focus on creating applications rather than how they are hosted. odo further extends their capabilities by providing a CLI that makes it simple to pick and choose what infrastructure to utilize when developing applications on OpenShift.

    More information on imagestreams can be found in the Red Hat OpenShift documentation. Official Red Hat and community-supported imagestreams can be found on the openshift/library GitHub repository as well as under the Software Collections GitHub organization.

    For information on odo, you can visit the OpenShift Do website and also check out the project's GitHub repository.

    To see a video version of this tutorial, visit the OpenShift blog.

    Last updated: March 28, 2023

    Recent Posts

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    What’s up next?

     

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.