This sample application shows how to package a Java EE 7 application as Docker image and run it within a container using Gradle Docker Plugin.
-
./gradlew build
builds the application.
-
Run
./gradlew startContainer
to run the Docker Container -
Access the application
curl http://locahost:8080/javaee-docker-gradle/resources/persons
. It shows the output:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><collection><person><name>Penny</name></person><person><name>Leonard</name></person><person><name>Sheldon</name></person><person><name>Amy</name></person><person><name>Howard</name></person><person><name>Bernadette</name></person><person><name>Raj</name></person><person><name>Priya</name></person></collection>