Sign inSign up

crocarneiro1998/java11-maven-env

By crocarneiro1998

Updated almost 7 years ago

A Ubuntu 18.04 environment with OpenJDK 11 and Maven

Image
0

308

crocarneiro1998/java11-maven-env repository overview

java11-maven-env

This is a Dockerfile used to build a Docker image derived from Ubuntu:18.04 with Open JDK 11 and Maven installed.

Usage

You can download it and build the image by yourself or just pull the image from DockerHUB and run it.

Building the image by yourself

Download or clone this repository, then open the command prompt or the terminal (if you're using linux) and run:

docker build . -t java11-maven-env
Building and running your java 11 Maven application

From prompt or terminal, in your application root directory (pom.xml should be here) follow the steps below:

Create container

Windows:

docker run -d -i --name my-java11-container --mount type=bind,source="%cd%",target=/source crocarneiro1998/java11-maven-env

# If you have build the image by yourself use this command below instead
docker run -d -i --name my-java11-container --mount type=bind,source="%cd%",target=/source java11-maven-env

Linux:

docker run -d -i --name my-java11-container --mount type=bind,source="(pwd)",target=/source crocarneiro1998/java11-maven-env

# If you have build the image by yourself use this command below instead
docker run -d -i --name my-java11-container --mount type=bind,source="(pwd)",target=/source java11-maven-env
Then open the bash
docker exec -i -t my-java11-container /bin/bash
Then just build your application with Maven
mvn package
The run your application
java jar target/my_application.jar

Tag summary

Content type

Image

Digest

Size

664 MB

Last updated

almost 7 years ago

docker pull crocarneiro1998/java11-maven-env