尝试使用 Dockerfile 时 OpenShift 出错

Error on OpenShift when trying to use Dockerfile

我刚开始使用 OpenShift,目前正在使用 60 天免费试用期。我希望在其中测试我的一些开发 Dockerfile,但是当我尝试使用任何 Dockerfile 时,我收到此错误:

admission webhook "validate.build.create" denied the request: Builds with docker strategy are prohibited on this cluster

重新创建: 开发人员视图 -> 拓扑 -> 来自 Dockerfile -> GitHub Repo URL = https://github.com/alpinelinux/docker-alpine -> 其他一切的默认值 -> 创建

这个例子只是使用官方的Alpine Dockerfile,并不能正常工作。

基于 Graham Dumpleton 制作的

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/3.11/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

OpenShift Online provides the source build strategy (S2I). Neither docker or custom build strategies are enabled. So you can build images in OpenShift Online, but only using the source build strategy.