vortitao.blogg.se

Glassfish java 8
Glassfish java 8











glassfish java 8

In the Dockerfile I add the hsqldb jar and the configure script: ADD hsqldb-2.3.2.jar /opt/app/extlib/hsqldb-2.3.2.jarĪDD configure-glassfish.sh /opt/app/bin/configure-glassfish.shĪfter building the Docker image, you can run Glassfish with the necessary configuration: docker run -rm -it -v ~/tmp/glassfish/deploy:/opt/glassfish4/glassfish/domains/domain1/autodeploy \ property "user=sa:password=sa:url=jdbc\:hsqldb\:hsql\:mem\:petclinic" \Īsadmin create-jdbc-resource -connectionpoolid PetClinicPool jdbc/petclinic The configure-glassfish.sh (in /opt/app/bin) script creates the necessary datasource: asadmin create-jdbc-connection-pool -restype= -datasourceclassname= \

glassfish java 8

#Glassfish java 8 driver

By adding the jar to /opt/app/extlib, the driver is copied to the Glassfish lib directory – this makes it available for datasources. The Glassfish server now needs a datasource configuration, including the database driver implementation for hsqldb.

glassfish java 8

I changed the configuration to use the Glassfish datasource. Normally, the petclinic application creates its own datasource, not a JEE datasource. Curiously, I needed to add “implements Serializable” to BaseEntity, to make it work on Glassfish 4.1. I cloned a copy of the Spring petclinic application ( ) to setup my development environment. v ~/tmp/glassfish/logs:/opt/glassfish4/glassfish/domains/domain1/logs. To view the logs directory you can add this: docker run. v ~/tmp/glassfish/deploy:/opt/glassfish4/glassfish/domains/domain1/autodeploy. You can mount this directory to your host with the -v option: docker run. Glassfish provides an autodeploy directory – just copy a war or ear file to this directory and Glassfish will deploy this automatically. In the Glassfish image (see ) I can add deploy a web application and hook into the file system. To make this productive, you need an easy way to deploy and debug your web application. Koert/alpine-glassfish-showcase 417.8 MB My examples at GithubĪlthough Docker is often used to deploy/run applications in a defined environment, you can also use Docker in your development environment. Koert/glassfish-showcase 1156 MB Alpine Linux + Java 8 + Glassfish 4.1 frolvlad/alpine-oraclejdk8 170.8 MB I am surprised about the size differences, see the resulting images: Phusion baseimage + Java 8 + Glassfish 4.1 phusion/baseimage 305 MB My Phusion based container produced an image 1130 MB large, while the Alpine Linux based image was only 392 MB. To produce a working application, I used the Primefaces showcase WAR. Since I prefer to use the Oracle JDK with Glassfish 4.1, I ran a few tests myself to compare a phusion baseimage with Alpine Linux. This article from Atlassian ( ) mentioned a minimal base image with OpenJDK. I have been using Docker to run Glassfish in a container and I noticed some news about using Alpine Linux.Apparently, you create much smaller containers with Alpine Linux.













Glassfish java 8