openfaas / templates

OpenFaaS Classic templates
https://www.openfaas.com
MIT License
276 stars 228 forks source link

Improved Docker for Java 11 Template #202

Open GoodforGod opened 4 years ago

GoodforGod commented 4 years ago

Changed base images to significatly reduce size of images, updated gradle, updated project gradle according to Gradle multi project guide lines. Improved bootstrap for function start up.

Description

Changed base image changed from just openJDK 11 to adoptopenjdk with alpine based images, thus it significantly reduces size of builder container and resulting image size from 250Mb (OpenJDK11) to 175Mb (AdoptOpenJDK Alpine Java 11) and for builder container from 562Mb for OpenJDK11 up to 401Mb for AdoptOpenJDK Alpine JDK 11.

Improved Gradle build flags to speed up build sequence.

Gradle wrapper for project itself updated to 6.3 and Gradle inside Docker updated to 6.3 to match each other.

Improved function start up time (bootstrap) by applying special java flags that can speed up application in case of serverless function.

Fixed README file version mistakes.

Motivation and Context

How Has This Been Tested?

Builded local function and

Types of changes

Impact to existing users

Gradle version in Docker container was 6.1 other wise, but it was old 4.8 as per project template itself (inconsistency between project and gradle build container), I propose consistency by updating all gradle up to 6.3

Checklist:

derek[bot] commented 4 years ago

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide. Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.