0
votes

I have an OpenShift origin (OKD) cluster setup on AWS. Jenkins being used for CICD pipeline deployment. Based in OpenShift docs, I am trying to use Source to Image (S2I) to convert my Java source code to image using redhat-openjdk-18/openjdk18-openshift image. I used following commands

Create new build

$ oc new-build --binary=true --name=bookstore --image-stream=openjdk18-openshift
--> Found image 24d98bd (7 days old) in image stream "cicd/openjdk18-openshift" under tag "latest" for "openjdk18-openshift"

    Java Applications
    -----------------
    Platform for building and running plain Java applications (fat-jar and flat classpath)

    Tags: builder, java

    * A source build using binary input will be created
      * The resulting image will be pushed to image stream "bookstore:latest"
      * A binary build was created, use 'start-build --from-dir' to trigger a new build

--> Creating resources with label build=bookstore ...
    imagestream "bookstore" created
    buildconf

Start Build

$ oc start-build bookstore --from-dir=./ocp --follow
Uploading directory "ocp" as binary input for the build ...
build "bookstore-1" started
Receiving source from STDIN as archive ...
pulling image error : open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory
error: build error: unable to get registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift@sha256:38dab2c3f60ade6857cc2a592184c964d3a51e2d3b5ef07def4b8ad4215d2bbf

As shown above, I get build error: unable to get registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift error while running the start-build command.

1
The Red Hat images for Java middleware products are only available if you are using OpenShift Container Platform product from Red Hat, and not from the open source upstream OKD variant of OpenShift. See if the 'java' S2I image bundled with OKD does what you need. - Graham Dumpleton
@GrahamDumpleton Where can I find Java S2I okd image? OKD docs shows same redhat image - Pavan Jadda
If you run oc new-app -L it will tell you what you have installed. You possibly have java and wildfly images. I don't know enough about Java to know which of these you might want to use. If you find those in the service catalog of the web console the descriptions should tell you what they are for. - Graham Dumpleton

1 Answers

0
votes

Thanks, Graham for the input. I was able to solve this by creating empty file on all nodes (master and worker) nodes

$ sudo vi /etc/rhsm/ca/redhat-uep.pem