A simple Java web applicaton developed using Quarkus framework to display a random quote of the day
Below steps will mention the prerequisites and the steps to be performed to get started
If you dont want the trouble of installing software, compiling the packages
and running the application then just download the docker hub using
docker pull rakgenius/quarkus-greetings
and run the image image using
docker run -i -d --rm -p 8080:8080 rakgenius/quarkus-greetings
Then navigate to
http://localhost:8080/greetings
Below are the softwares that needs to be installed as a dependency
GraalVM
Maven
Docker (to build Docker image)
GraalVm can be installed and configured by following the steps
mentioned here
Once the prerequisite softwares are installed you can continue further
1 . Git clone the repo to any machine
2 . Build the packages using the command
./mvnw package -DskipTests
3 . To build the native packages, run
./mvnw package -DskipTests -Pnative
4 . Run the application using
java -jar target/greetings-1.0-runner.jar
5 . Run the native application using
./target/greetings-1.0-runner
6 . Navigate to
http://localhost:8080/greetings
Below are the command to build the docker image and to publish it to docker hub
1 . After creatin the native package, run the below command
./mvnw package -DskipTests -Pnative -Dnative-image.docker-build=true
2 . Create the docker image using
docker build -f src/main/docker/Dockerfile.native -t quarkus/greetings .
3 . Run the docker image using
docker run -i -d --rm -p 8080:8080 quarkus/greetings
4 . Create your own image which has to be pushed to the docker hub
docker image ls
Get the "IMAGE ID" of "quarkus/greetings" image
Set the tag to your image
docker tag <IMAGE TAG OBTAINED ABOVE> <your dockerhub username>/quarkus-greetings:latest
5 . Now push the docker image to docker hub
docker push <your docker hub username>/quarkus-greetings
6 . Now you can pull the image on any machine anywhere using
docker pull <your dockerhub username>/quarkus-greetings
And run it using the command mentioned in step 3.
- Maven - Dependency Management
Rakesh Venkatesh