Skip to content
This repository was archived by the owner on Jul 29, 2018. It is now read-only.

Latest commit

 

History

History
67 lines (54 loc) · 1.98 KB

File metadata and controls

67 lines (54 loc) · 1.98 KB

Staging your application with the OpenShift registry

You can prepare your application for production locally with the internal OpenShift Docker registry.

The scenario assumes the following parameters:

  • OpenShift registry endpoint is hub.openshift.adb

  • OpenShift instance URL is https://10.1.2.2:8443

  • Username/password credentials is openshift-dev/devel

  • Default ADB project name is sample-project

  • Application name is my-app

This scenario is intended to illustrate how to test an application Docker image to a local instance of OpenShift platform that runs in the ADB box which on your host before push the image to a public instance of OpenShift.

  1. Expose the host name of the OpenShift registry with the vagrant service-manager env command.

    $ vagrant service-manager env openshift
    
    # You can access the OpenShift console on: https://10.1.2.2:8443/console
    # To use OpenShift CLI, run: oc login https://10.1.2.2:8443
    export OPENSHIFT_URL=https://10.1.2.2:8443
    export OPENSHIFT_WEB_CONSOLE=https://10.1.2.2:8443/console
    export DOCKER_REGISTRY=hub.openshift.adb
    
    # run the following command to configure your shell.
    # eval "$(vagrant service-manager env openshift)"
  2. Build the Docker image as usual.

  3. Make sure you are logged in to OpenShift.

    $ oc login 10.1.2.2:8443 -u openshift-dev -p devel
  4. Tag the image against the OpenShift registry with the hostname that you retrieved from the vagrant service-manager env command.

    $ docker tag my-app hub.openshift.adb/sample-project/my-app
  5. Log in to the OpenShift registry.

    $ docker login -u openshift-dev -p `oc whoami -t` -e foo@bar.com hub.openshift.adb
  6. Push the image to the registry to create an image stream with the same name as the application.

    $ docker push hub.openshift.adb/sample-project/my-app
  7. Create an application from the image stream and expose the image.

    $ oc new-app --image-stream=my-app --name=my-app
    $ oc expose service my-app --hostname=my-app.adb