Payara Micro S2I for OKD
Payara Micro Source To Image for OpenShift
Payara Micro s2i Builder for OpenShift
The s2i-payara-micro builder simplifies build, configuration and deployment of ThinWARs in cloud native environments like OpenShift and docker.
Getting started
The s2i-payara-micro inherits from the payara-micro-s2i and indirectly java8-s2i docker images from Docklands. The base CentOS 7 operating system, Java and Payara 5 are inherited.
Instead of building the universe, s2i-payara-micro configures the Payara 5 server using stock pre-boot scripts, copies 3rd-party libraries like e.g. JDBC-drivers and deploys a ThinWAR from the local folder.
Also checkout the thin.war example.
Payara configuration
Create a asadmin-preboot or asadmin-postboot scripts to configure the application server: https://docs.payara.fish/documentation/payara-micro/asadmin/pre-and-post-boot-scripts.html
Building the builder
The build is based on Payara Micro 5 s2i base image from docklands, published to
dockerhub airhacks/payara-micro-s2i:5.192.
- Clone
https://github.com/AdamBien/docklands.git cd java/java8-s2i/anddocker build -t airhacks/java-s2i .cd payara-micro-s2ianddocker build -t airhacks/payara-micro-s2i:5.192
Now build the builder:
git clone https://github.com/AdamBien/s2i-payara-microdocker build -t airhacks/s2i-payara-micro .
Installing on OpenShift
- Import the image into an image stream:
oc import-image s2i-payara-micro --from=airhacks/s2i-payara-micro:latest --confirm - Create an app from the imported image:
oc new-app s2i-payara-micro:latest~/. --name=thinwar - Start a build:
oc start-build --from-dir . thinwarfrom a directory with the following contents:
| File | Required? | Description |
|---|---|---|
| *.war | Yes | The ThinWar / microservice |
| ext/*.jar | No | JDBC drivers and external libraries |
| asadmin-preboot | No | Payara configuration preeboot script |
| asadmin-postdeploy | No | Payara configuration postdeploy script |
| asadmin-postboot | No | Payara configuration postboot script |
| env-file | No | Build-time env-entries |
Also see a ThinWAR example
