Public Repository

Last pushed: 4 months ago
Short Description
A Docker build for the oc command line tool, used to control Openshift.
Full Description

Command line tool for interacting with Openshift 3

Summary

  • A Docker build for the oc command line tool, used to control Openshift. For more info, see Get Started with the CLI

  • This image will be used in Bitbucket pipeline to deploy in Openshift

Example bitbucket-pipelines.yml

image: jhidalgo3/openshift-node-docker:7-alpine
clone:          # the 'clone' section
  depth: 1

options:
  docker: true

pipelines:
  default:
    - step:
        script:
          - yarn install
          - yarn build
          - export IMAGE_NAME=$DOCKER_HUB_USERNAME/react-openshift:$BITBUCKET_COMMIT
          - docker build -t $IMAGE_NAME .
          - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
          - docker push $IMAGE_NAME
          - oc login $OPENSHIFT_HOST --insecure-skip-tls-verify=true --username=$OPENSHIFT_USER --password=$OPENSHIFT_PASSWORD

Requirements

To build the Docker image

  • Build the image using docker
    $ docker build -t openshift-node-docker .
    
  • Run the container
    $ docker run -ti --rm openshift-node-docker oc version
    
  • Optionally add an alias to your local profile so you can run the container as a cli (you may also want to mount kube config or pass env vars...)
    $ alias oc='docker run --rm -ti openshift-node-docker oc'
    $ oc version
    

Alternatively, you can use the Docker Hub automated build

$ docker pull jhidalgo3/openshift-node-docker

Contributing

File issues in GitHub to report bugs or issue a pull request to contribute.

Original

https://github.com/danielwhatmuff/openshift-oc-docker

Docker Pull Command
Owner
jhidalgo3

Comments (0)