GithubHelp home page GithubHelp logo

grzesuav / jready Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xfournet/jready

0.0 3.0 0.0 129 KB

A set of Docker image that are ready to execute a JRE

License: Apache License 2.0

Dockerfile 88.16% Shell 11.84%

jready's Introduction

JRE ready Docker image

jready is a set of minimalist Docker images that are ready to execute a JRE.

More than a small size, the goal of minimal Docker image is to enhance security by reducing the attack surface.

Note than theses images don't include a JRE:

  • you can freely to choose the JRE vendor (eg Oracle or OpenJDK) and version (tested from 1.7 to 11)
  • with JRE 9 and higher, you can freely build your own minimal JRE thanks to jlink. See example below.

An example below shows how a JRE can be integrated on top of theses images.

BusyBox based (busybox/Dockerfile)

Based on the offical BusyBox glibc image

Alpine based (alpine/Dockerfile)

Based on the offical Alpine image and Alpine GLIBC package

Example

This example is based on OpenJDK 11. The example starts from the busybox based image but alpine can be used instead without any further changes in the Dockerfile.

Dockerfile

Create a minimal JRE image. If needed the JLINK_MODULES list (comma-separated) can be completed to fit other needs.

FROM xfournet/jready:busybox

ARG JDK_URL=https://download.java.net/java/GA/jdk11/28/GPL/openjdk-11+28_linux-x64_bin.tar.gz
ARG JLINK_OPTIONS="--vm=server --compress=2 --no-header-files --no-man-pages"
ARG JLINK_MODULES="java.base"
ARG JRE_DIR="/opt/jre"

RUN \
    # Download and extract JDK
    wget ${JDK_URL} -O - | tar xz -C /tmp && \
    # Build customized JRE
    /tmp/jdk-*/bin/jlink --output ${JRE_DIR} --add-modules ${JLINK_MODULES} ${JLINK_OPTIONS} && \
    # Remove JDK
    rm -r /tmp/jdk-* 
    
ENV PATH="${JRE_DIR}/bin:${PATH}"    

Image build and test

docker build -t myjre .
docker run --rm -ti myjre

# in container
java --version

jready's People

Contributors

xfournet avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.