[英]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 login
和docker 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.