问题
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