首页 > 解决方案 > 在 OpenShift 部署中无法获取 registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift 映像错误

问题描述

我在 AWS 上有一个 OpenShift 源 (OKD) 集群设置。Jenkins 被用于 CICD 管道部署。基于 OpenShift 文档,我正在尝试使用 Source to Image (S2I) 将我的 Java 源代码转换为使用image 的redhat-openjdk-18/openjdk18-openshift图像。我使用了以下命令

创建新版本

$ 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

开始构建

$ 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

如上图,运行 start-build 命令时出现build error: unable to get registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift错误。

标签: javajenkinsjenkins-pipelineopenshiftopenshift-origin

解决方案


谢谢,格雷厄姆的意见。我能够通过在所有节点(主节点和工作节点)节点上创建空文件来解决这个问题

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

推荐阅读