简体   繁体   中英

Allow Docker strategy in Openshift 3

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

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:

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM