Example of building and deploying from a Dockerfile in Openshift 4.
$ oc new-app --name sleep https://github.com/svejk-ciber/openshift-dockerfile-example.git
You can also use the argument--strategy=docker
to be explicit, but in this case there is no ambguity, since there are no other source files present than the Dockerfile, so Openshift should not choose a different build strategy than Docker.$ oc status
Should not indicate any problems, apart from missing probes.- Check the build log for errors:
$ oc logs bc/sleep
- Wait for the pod to become running:
$ oc get pods -w
- Check the log of the running container:
$ oc logs sleep-1...
- Observe that
new-app
has created the following resources: one build configuration, one deployemnt configuration one replication controller, one build and two image streams (oc get bc|dc|is|rc|build|pod...)