Accessing the OpenShift Docker Registry
Overview
OpenShift provides an integrated Docker registry which can be used for development as well. Images present in the registry can directly be used for applications, speeding up the local development workflow.
Logging Into the Registry
Start Minishift and add the
oc
binary to thePATH
. For a detailed example, see the Minishift Quickstart section.Make sure your shell is configured to reuse the Minishift docker daemon.
Log into the OpenShift Docker registry.
$ docker login -u developer -p $(oc whoami -t) $(minishift openshift registry)
Deploying Applications
The following example shows how to deploy an OpenShift application directly from a locally-built Docker image. This example uses the OpenShift project myproject. This project is automatically created by minishift start
.
Make sure your shell is configured to reuse the Minishift docker daemon.
Build the Docker image as usual.
Tag the image against the OpenShift registry:
$ docker tag my-app $(minishift openshift registry)/myproject/my-app
Push the image to the registry to create an image stream with the same name as the application:
$ docker push $(minishift openshift registry)/myproject/my-app
Create an application from the image stream and expose the service:
$ oc new-app --image-stream=my-app --name=my-app
$ oc expose service my-app
If you want to deploy an application using
|