docker - 使用 s2i 为本地存储库构建映像
问题描述
我正在尝试按照本文档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
推荐阅读
- pyspark - 在 pyspark 中读取 tsv 文件
- postfix-mta - 后缀忽略 maxal_queue_lifetime 设置
- linux - 如何从特定行到文件末尾grep一个单词?
- sql - 来自多个表的 CASE 表达式
- php - 影响文本框高度的php错误消息
- python - 3x3 noughts 和 crosss 并确定是否有赢家
- java - 分析/调试 java Swing 中触发的事件的最佳方法是什么
- python - 名称(变量名)未定义错误
- javascript - Vue Js条件关闭div标签
- python - Jupyter Notebook 内核在尝试调用 elasticsearch 时死亡