First lets create a simple PHP code, and name it index.php
<?php echo "hello world"; ?>
We want to deploy it on top of PHP 7 images, and make it online on Openshift Platform.
So how to do it basically consist of 3 steps.
1. First we need to create a new binary build, using preferred image stream as its base image
oc new-build --name=my-php --image-stream=php:7.0 --binary=true
2. Next is start building image using sourcecode’s directory
oc start-build my-php --from-dir=.
3. Last is create application using previously built image
oc new-app my-php --name=my-php
So simple right 🙂