Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 946 Bytes

readme.adoc

File metadata and controls

21 lines (14 loc) · 946 Bytes

Run Java EE Application as Docker Container using Gradle

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.

  1. ./gradlew build builds the application.

Build Docker Image

  1. Start Docker for Mac

  2. Run ./gradlew buildImage to create the Docker Image

Run Docker Container

  1. Run ./gradlew startContainer to run the Docker Container

  2. 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>