Sign inSign up

stevenacoffman/java9-jlink-web

By stevenacoffman

Updated almost 9 years ago

A sample Java9 HTTP server in 35MB Docker container

Image
0

245

stevenacoffman/java9-jlink-web repository overview

Smaller Java 9 apps in Docker

This project showcases what is in my opinion the coolest features in JDK 9:

  • ability to create custom runtime for your application
  • native support for Alpine Linux

This translates to less disk space and faster startup times than the full JVM. Whether or not it improves memory usage or speed after initial startup is an open question in my mind.

TL; DR version
GIT_REVISION=$(git rev-parse HEAD)
REPOSITORY=stevenacoffman/java9-jlink-web
docker build \
        -t "${REPOSITORY}:GITSHA-${GIT_REVISION}" \
        -t "${REPOSITORY}:latest" \
        .
docker run -it -p 9000:9000 stevenacoffman/java9-jlink-web
Acknowledgments
Run the container image

Running the container is old news:

  docker run -p 9000:9000 stevenacoffman/java9-jlink-web

Tag summary

Content type

Image

Digest

Size

21.7 MB

Last updated

almost 9 years ago

docker pull stevenacoffman/java9-jlink-web