在Openshift 3中允许Docker策略 [英] Allow Docker strategy in Openshift 3

查看:61
本文介绍了在Openshift 3中允许Docker策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解新的OpenShift系统,现在我们可以将图像推送到它了.我对Docker有一点了解,我想使用它.我在某些地方读到我们可以选择Docker作为策略.

I'm trying to understand the new OpenShift system and now we have push images to it. I know a little about Docker and I wanted to use it. I read in some places that we can chose Docker as a strategy.

所以基本上我创建了基于 httpd 和基本html文件的图像,并尝试使用以下命令从项目文件夹中将其推送:

So basically I created an image based on httpd and a basic html file and tried to push it with the following command from the project folder:

oc new-app . --strategy=docker

我在控制台上收到此消息:

I get this message on console:

错误:buildconfigs.build.openshift.io禁止"openshift":禁止构建策略Docker

error: buildconfigs.build.openshift.io "openshift" is forbidden: build strategy Docker is not allowed

我该怎么做才能允许它?我在任何地方都看不到很好的解释...

What do I have to do to allow it? I don't see a good explanation anywhere...

推荐答案

如果使用的是OpenShift Online,则无法启用 docker 构建类型.对于OpenShift Online,您的选择是在本地构建映像,然后将其推送到外部映像注册表,例如Docker Hub,或登录到内部OpenShift注册表,然后将映像直接推送到其中.然后可以在部署中使用该映像.

If you are using OpenShift Online, it is not possible to enable the docker build type. For OpenShift Online your options are to build your image locally and then push it up to an external image registry such as Docker Hub, or login to the internal OpenShift registry and push your image directly in to it. The image can then be used in a deployment.

如果您设置了自己的OpenShift集群,则我的理解是,默认情况下应启用 docker 构建类型.您可以在以下位置找到更多详细信息:

If you have set up your own OpenShift cluster, my understanding is that docker build type should be enabled by default. You can find more details at:

如果您正在寻找使用 httpd Web服务器部署站点的方法,则可以使用S2I构建器映像来实现.参见:

If you are after a way to deploy a site using a httpd web server, there is a S2I builder image available that can do that. See:

这篇关于在Openshift 3中允许Docker策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆