Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

A minimal Java API service with Quarkus with native executable builds

License

Notifications You must be signed in to change notification settings

aleveille/quarkus-minimal-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quarkus minimal service example with GraalVM native binary build packaged into a Docker image

This is a minimal Java API service implemented by following the Quarkus getting started guide.

This repo aims to give a working example of building a minimal but working Java 11 API service that will be built into a native Linux binary using GraalVM. This binary is then packaged into a Docker image for ease of deployment and execution across platforms and cloud providers.

This repository, when it was originally bootstrapped from Maven, came with its own README file.

Tooling

Note that there's also a Dockerized build, which mean that you can build this repo without having to install anything if you're just looking to give Quarkus a trial run.

Building

Assuming you have everything installed and configured according to Quarkus and GraalVM instructions, you can build this project like this:

./mvnw package -Pnative -Dquarkus.native.container-build=true
docker build -f src/main/docker/Dockerfile.native -t quarkus-minimal-service .

If you do not wish to install these things, you can use a multistage Docker build as explained by Quarkus.

In short, you simply need to delete the .dockerignore file and then use the multi-stage build file of this repo:

rm .dockerignore
docker build -f src/main/docker/Dockerfile.multistage -t quarkus-minimal-service .

The build, regardless of the method, takes about 4 minutes on my Machine (MacBook Pro 2018, 2.3 GHz Quad-Core Intel Core i5).

You can then run docker run -i --rm -p 8080:8080 quarkus-minimal-service to start a Docker container running the native executable and point your browser to http://localhost:8080/greeting/yourname to test it out.

License

All the content in this repository that is my authorship (code that I wrote) is made freely available for anyone to use without any restriction. See the unlicense of this repository. However, all the trademarks, copyrights , logos and whatnot that I might have included, used or mentioned in this repository are the property of their respective owners.

About

A minimal Java API service with Quarkus with native executable builds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published