Although Openshift is able to use docker images, it has much more restrictions. Thus not all docker images can work straight on Openshift. Unfortunately, the official
nginx docker image does not work on openshift.
In this post, I will simply go through how to run this Official RedHat nginx image on Openshift and deploy a website onto it.
So, have your openshift cli tool (oc) ready, let’s get started.
oc tool, create a new app.
The openshift will pull the image from the registry and register it locally as builder image which will allow building images along with source code of website. It creates
Then it will pull source code and
assemble it with build image to produce another image stream.
This command will also create
deployment config and
If you have no accessible git repo, it is able to build againt local source.
Slightly different, create a new app on current folder
This will not actually upload the source code from current folder to Openshift but just create a build config. Thus we need to start the build with extra parameters:
oc will upload content of current directory and builder image will
assemble the code.
Once app is created and built, we could expose it through
Once it is exposed, your nginx server and your website should be accessible with the route associated.