How to create custom openJDK image with RHOCP4 CLI (oc client) installed

Solution Verified - Updated -

Issue

  • How to install the RHOCP4 CLI (oc client) in an openJDK image and create a custom container image?
  • How to create custom container image based on openJDK image with RHOCP4 CLI (oc client) installed?
  • The oc commands are failing with below error inside the openJDK container:

    $ podman exec -it <image-name>:<image-tag> /bin/bash
    # oc version
    bash: oc: command not found
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Podman
    • 5
  • Red Hat Enterprise Linux
    • 7
    • 8
    • 9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content