使用 s2i 为本地存储库构建图像

Build image with s2i for local repository

我正在尝试按照本文档 https://github.com/openshift/source-to-image/blob/master/docs/cli.md 使用 s2i 本地源代码存储库构建图像。到目前为止,我设法创建了图像并使用 - 生成了 s2i 脚本 s2i create test-image s2i_scripts。之后,我尝试使用 - s2i build . test-image test-image-app 在存储库目录中使用 运行 这个命令在本地构建图像。

我尝试构建后得到的结果:

pulling image error : Error response from daemon: pull access denied for test-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
pulling image error : Error response from daemon: pull access denied for test-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: An error occurred: unable to get test-image:latest
ERROR: Suggested solution: check image name, or if using a local image set the builder image pull policy to "never"
ERROR: If the problem persists consult the docs at https://github.com/openshift/source-to-image/tree/master/docs. Eventually reach us on freenode #openshift or file an issue at https://github.com/openshift/source-to-image/issues providing us with a log from your build using log output level 3.

也做了docker login,成功了...但是当我再次尝试构建时,错误还是一样。我错过了什么或做错了什么?

它失败的原因是我没有提取基础映像来将其用于我的源代码。所以我提取了 centos7 基本映像 - podman pull centos/python-36-centos7 然后我尝试再次构建并且它成功了 - s2i build . centos/python-36-centos7 test-image-app