Giter Site home page Giter Site logo

openshift-s2i-example's Introduction

This repo demonstrates openshift v3 s2i scripts usage

In order to use openshift s2i image create directory .s2i and files under s2i as follows
To Install s2i command line tool https://github.com/debianmaster/Notes/wiki/Source-2-Image---(s2i)--on-openshift

assemble.sh

This file is used dynamically adding artifacts into base image and creating a app image as a result.

cp -Rf /tmp/src/. $CATALINA_HOME/webapps
echo "WAR's copied"

run.sh

This file is used for mentioning startup script.

${CATALINA_HOME}/bin/catalina.sh run

Create builder image

tomcat8-jdk8 is my future builder image name

docker build -t tomcat8-jdk8 .

Test builder image by deploying war (Optional)

on base image tomcat8-jdk8 deploy the war (contents) that is present in test/test-app and make a app image called (tomcat8-jdk8-app)

s2i build test/test-app tomcat8-jdk8 tomcat8-jdk8-app

Test the app image

docker run -d  -p 8080:8080  tomcat8-jdk8-app 

Using the template provided in this repo.

oc import-image --from=openshift/base-centos7 openshift/base-centos7 -n openshift --confirm
oc new-build --strategy=docker --name=tomcat8-jdk8 https://github.com/debianmaster/openshift-s2i-example.git -n openshift
oc create -f tomcat8-jdk8-war.template

Goto ui -> Add to project and look for tomcat8-jdk8-war template. In the step above we are creating a base image with tomcat and java and storing it on openshift namespace

alt text

You can skip the part below unless you want to know how i have create the tomcat8-jdk8-war.template file in this repo

Creating template on Openshift (Optional)

i have arrived at the template tomcat8-jdk8-war.template in this repo by creating following objects indivudually and then creating a template out of it. (with few modifications)

Create Image stream & export templates

oc new-app tomcat8-jdk8~https://github.com/debianmaster/sample-binaries.git --name='tomcat8-jdk8-war'
oc export is,bc,dc,svc --as-template=tomcat8-jdk8  > template

Modify the template above and rename it as tomcat8-jdk8-war.template

openshift-s2i-example's People

Contributors

debianmaster avatar dynamostack avatar rgupta1234 avatar

Watchers

James Cloos avatar

Forkers

rgupta1234

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.