Allow Docker strategy in Openshift 3

旧时模样 提交于 2021-01-27 15:57:51

问题


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.

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:

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...


回答1:


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.

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:

  • https://docs.openshift.com/container-platform/latest/admin_guide/securing_builds.html

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:

  • https://github.com/sclorg/httpd-container



回答2:


You could always setup Minishift locally to build your images using the Docker build strategy if you wanted to gain experience with this strategy.

https://docs.openshift.org/latest/minishift/getting-started/installing.html



来源:https://stackoverflow.com/questions/46839811/allow-docker-strategy-in-openshift-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!