Skip to content

ibraheeamm/javaee-docker-gradle

 
 

Repository files navigation

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>

About

Java EE 7 Simple Application using Gradle and Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%