Create an OpenShift ImageStream
Create an OpenShift Imagestream
Arlen High has decided to consolidate their OpenShift project with Tom Landry high school, but they need your help importing the Docker container that hosts the website. Import the image into the OpenShift container registry so that it is available to users under the
Edit Create an OpenShift ImageStream
Arlen High has decided to consolidate their OpenShift project with Tom Landry high school, but they need your help importing the Docker container that hosts the website. Import the image into the OpenShift container registry so that it is available to the users under the arlen-high project.
Log in to the OpenShift cluster using the credentials provided on the hands-on lab page:
Become the root user:
Check the health of the cluster:
oc get nodes
Create the project that they will use for their application:
oc new-project arlen-high --description="Arlen Tx Engineering project"
Create the user account for the administrator of the project:
htpasswd -b /etc/origin/master/htpasswd peggy propanerules
peggyadmin privileges to the
oc adm policy add-role-to-user admin peggy -n arlen-high
registry-viewerclusterrole to peggy
oc adm policy add-role-to-user registry-viewer peggy
registry-editorclusterrole to peggy
oc adm policy add-role-to-user registry-editor peggy
Switch to the arlen-high project
oc project arlen-high
Since the docker file will try to run this image as root and OpenShift will not allow this, we will need to add an exception.
oc adm policy add-scc-to-user anyuid -z default
Download Arlen High's image tomlandy
wget -O tomlandry.tar.xz https://github.com/linuxacademy/content-openshift-ex280/raw/release-3.9/docker-images/tomlandry.tar.xz
tomlandry.tarimage into docker
docker load -i tomlandry.tar.xz
Check to see if the image is there.
Find the registry URL on
oc get routes -n default
Login as peggy
oc login https://okd.10.0.2.203.xip.io:8443 -u peggy -p propanerules -n arlen-high
Login to the docker registry as peggy
docker login docker-registry-default.apps.okd.10.0.2.204.xip.io -u $(oc whoami) -p $(oc whoami -t)
tomlandry:v1image in the following format:
docker tag tomlandry:v1 docker-registry-default.apps.okd.10.0.2.204.xip.io/arlen-high/tomlandry:latest
Push the tagged image into the container registry
docker push docker-registry-default.apps.okd.10.0.2.204.xip.io/arlen-high/tomlandry:latest
Check your imageStream
oc get is
As Peggy, create an application using the docker image you just imported.
oc new-app --image-stream=tomlandry --name="tomlandry-high"
Congratulations, you've completed this hands-on lab!