简体   繁体   English

如何在OpenShift Online的buildConfig中指定Dockerfile构建?

[英]How can I specify Dockerfile build in buildConfig for OpenShift Online?

Openshfit details: Paid Professional version. Openshfit详细信息:付费专业版。 Version Information: 版本信息: 在此输入图像描述

Been trying to create a build from a Dockerfile in Openshift. 一直在尝试从Openshift中的Dockerfile创建构建。 Its tough going. 它艰难前行。 So I tried to use the existing templates in the Cluster Console. 所以我尝试使用Cluster Console中的现有模板。 One of which is the Docker one. 其中一个是Docker。 When i press "Try it" it generates a sample BuildConfig, when I try to then Create it, it gives me the error: 当我按下“试试”它会生成一个示例BuildConfig,当我尝试然后创建它时,它会给我错误: 在此输入图像描述 (i have now raised the above in the Origin upstream issue tracker) Anyhoo...anyone know how to specify a buildConfig an image from a Dockerfile in a git repo? (我现在在Origin上游问题跟踪器中提出了上述内容)Anyhoo ...任何人都知道如何在git repo中指定一个buildConfig来自Dockerfile的图像? I would be grateful to know. 我很高兴知道。

You can see the build strategies allowed for OpenShift Online on the product website: https://www.openshift.com/products/online . 您可以在产品网站上看到OpenShift Online允许的构建策略: https//www.openshift.com/products/online Dockerfile build isn't deprecated, it's just explicitly disallowed in OpenShift Online. 不推荐使用Dockerfile构建,只是在OpenShift Online中明确禁止它。 You can build your Dockerfile locally and push it directly to the OpenShift internal registry (commands for docker login and docker push are on your cluster's About page). 您可以在本地建立你Dockerfile并直接将其推到OpenShift内部注册表(对命令docker logindocker push是群集的关于页)。

However, in other environments (not OpenShift Online), you can specify a Dockerfile build as follows and providing a Git Repo with a Dockerfile contained within (located at BuildConfig.spec.source.contextDir ) 但是,在其他环境(不是OpenShift Online)中,您可以如下指定Dockerfile构建并提供包含在其中的Dockerfile的Git Repo(位于BuildConfig.spec.source.contextDir

strategy:
  type: Docker

There are additional options that can be configured for a Dockerfile build as well, outlined in https://docs.okd.io/latest/dev_guide/builds/build_strategies.html#docker-strategy-options . 还可以为Dockerfile构建配置其他选项,如https://docs.okd.io/latest/dev_guide/builds/build_strategies.html#docker-strategy-options中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 openshift 本机资源定义导出到 yaml 文件,例如 Project/DeploymentConfig/BuildConfig - How can i export openshift native resource defination to yaml file, like Project/DeploymentConfig/BuildConfig Openshift buildconfig 中基于内部版本号的动态标签 - Dynamic tag based on build number in Openshift buildconfig 如何在OpenShift Online中配置通配符/ catchatch域? - How can I configure wildcard/catchall domains in OpenShift Online? 如何从 Openshift Online 中的另一个命名空间访问服务? - How can I reach a service from another namespace in Openshift Online? OpenShift 在线 - 构建时 OutOfMemory - OpenShift online - OutOfMemory on build 如何使用 Jenkins 和 openshift 定义 BuildConfig 对象 - How to define BuildConfig object with Jenkins and openshift 如何在Openshift Origin上构建git标签? - How can I build a git tag on Openshift Origin? 如何在Openshift中为构建配置提供多个源输入 - How can I provide multiple source inputs for a build config in Openshift 当我的RAILS_ENV设置为开发时,如何强制在OpenShift Online上捆绑安装? - How can I force a bundle install on OpenShift Online when my RAILS_ENV is set to development? 如何在 BuildConfig 中使用可选图像输入 - How can I use Optional Image Inputs in BuildConfig
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM