Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.91 KB

PyLab2.md

File metadata and controls

60 lines (38 loc) · 2.91 KB

Deploy an application using a GitHub repo and a Dockerfile

Dockerfile for Python Apps

docker login

Navigate to project folder and create Dockerfile to run the app. Here are the relevant Docker docs:

# Docker Docs: https://docs.docker.com/
# Docker Reference: https://docs.docker.com/reference/

For this workshop, we will use the following repository that has an example Dockerfile. MAX Object Detector is an :

https://github.com/IBM/MAX-Object-Detector

Get Access to Red Hat OpenShift Workshop Cluster

Use the steps below to get access to a Red Hat OpenShift cluster.

NOTE: Cluster Allocations are limited by time on Open Labs. Please make sure to complete the labs as soon as possible Clusters will shut down approximately 3 to 4hrs after spinning up

  1. Navigate to:

https://developer.ibm.com/openlabs/openshift

  1. Select "Bring Your Own Application" Openlab Screen Shot 2021-09-24 at 11 46 20 PM

  2. You will be asked to sign in with your IBM account.

    • Sign up for a IBM Cloud Account if you don't already have one Sign up here
    • Sign in to your temporary RHOS cluster

Red Hat OpenShift Workshop Cluster

  1. Once you are in the lab, open the Openshift Console Screen Shot 2021-09-25 at 12 00 03 AM

  2. Switch over to "Developer Mode" by selecting the option on the left side panel Screen Shot 2021-09-25 at 12 13 09 AM

  3. Add a project workspace to run your apps Screen Shot 2021-09-25 at 12 18 07 AM

  4. Create a "demo" project Screen Shot 2021-09-25 at 12 27 11 AM

  5. Select "Dockerfile" as the way to create an application Screen Shot 2021-09-25 at 1 32 37 PM

  6. Set the github url to the MAX Object Detector repo and port to 5000 Screen Shot 2021-09-25 at 1 35 30 PM

  7. Oila! Your Dockerfile was converted into an image that is pushed into the Openshift Image Registry and is now a running app on Openshift. Wait for the Pod's status to change to Running then navigate to th Network Route to launch the app.