GlassFish 5.0 represents the reference implementation of Java EE 8. We can dockerize Java EE 8 applications by using a GlassFish base image, such as the official oracle/glassfish.
The Dockerfile of a zero-dependency Java EE 8 application looks like follows:
COPY target/application.war $GLASSFISH_HOME/glassfish/domains/domain1/autodeploy/
A Docker container of that image starts the application server and auto-deploys our application.
application.war is packaged a thin WAR deployment artifact, what speeds up build, publishing and deployment times. The WAR file comprises only application-specific classes, no implementation-specific JAR files. If needed, any dependencies are added on top of the base image — before the actual application.
Imagine, we want to add the Prometheus Java API: Read the complete article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.