Skip to content

Tips and Tricks

Shea Phillips edited this page Oct 4, 2016 · 4 revisions

Pushing an image to OpenShift internal registry

There is a known issue with OpenShift version 3.2 that cause some base images from dockerhub to be "un pullable" as part of an OpenShift docker build. The steps below can be followed to work around this issue.

Example below is showing how the "node:onbuild" image could be pushed to the internal OpenShift registry, and be made available as an ImageStreamTag in the "pushtest" project. Replace the image names/tags and project names as appropriate. You will need to have docker install on the host you will be pushing 'from'.

  1. Retrieve your OpenShift login token from https://console.pathfinder.gov.bc.ca:8443/console/command-line ; you'll use this in the steps below.

  2. Pull the image to your local workstation.

docker pull node:onbuild

  1. Tag the image, including the target project name in the spec. In this case "pushtest".

docker tag node:onbuild docker-registry.pathfinder.gov.bc.ca/pushtest/node:onbuild

  1. Log in to the docker registry using your OpenShift/github username and token.

docker login docker-registry.pathfinder.gov.bc.ca -u <username> -p <token>

  1. Push your image

docker push docker-registry.pathfinder.gov.bc.ca/pushtest/node:onbuild

You should now see the a new ImageStreamTag show up under "Image Streams" in the project view of the web console and you should be able to perform docker builds that rely on the image you just pushed as a base image.

Work Around macOS Sierra issues with oc client

Per this link. The workaround is as follows:

WORKAROUND for people who already updated to Sierra: 
Use the brew version: brew install openshift-cli It is already compiled for Sierra.