VirusTotalNet icon indicating copy to clipboard operation
VirusTotalNet copied to clipboard

Improved Docker for Java 11 Template

Open GoodforGod opened this issue 4 years ago • 1 comments

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

  • Significantly reduce image sizes
  • Improved function start up time
  • Update project gradle to fix gradle version inconsistency
  • Make project structure for multi model Gradle project as it should be

How Has This Been Tested?

Builded local function and

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [x] Version change (see: Impact to existing users)

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:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [x] I have signed-off my commits with git commit -s
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

GoodforGod avatar Apr 05 '20 11:04 GoodforGod

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.

derek[bot] avatar Apr 05 '20 11:04 derek[bot]