Hustlin
Hustlin

Reputation: 81

Error on OpenShift when trying to use Dockerfile

I just started using OpenShift and currently using the 60 day free trial. I was hoping to test some of my developmental Dockerfiles in it, but when I try to use any Dockerfile I get this error:

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

To recreate: Developer view -> Topology -> From Dockerfile -> GitHub Repo URL = https://github.com/alpinelinux/docker-alpine -> Defaults for everything else -> Create

This example just uses the official Alpine Dockerfile and it does not work.

Upvotes: 0

Views: 1027

Answers (1)

Jakub
Jakub

Reputation: 8830

Based on this answer made by 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.

Upvotes: 2

Related Questions