Public | Automated Build

Last pushed: 16 days ago
Short Description
Minimal Java Runtime Environment based on Alpine Linux
Full Description

Minimal Java Runtime Environment

Good to go for Play Framework apps and other stuff, of course.

Since the official Java repository on Docker Hub now also has minimal images based on Alpine Linux, there is not much point in maintaining this repository any longer.

OpenJDK JRE 8 (including Bash)

Less than 120 MB image: cloudunder/java-runtime:openjdk8

The only difference to the official java:8-jre-alpine image is that this one has bash installed, which is handy to start a Play application using the bash script that comes with a build (e.g. sbt stage).

JRE 7

No longer maintained.

A very small Docker image with a Java Runtime Environment (OpenJDK 7) based on Alpine Linux. We also installed the Bash shell, because we want to use this as a base image for Play Framework web applications and the standard start script of a Play app is a Bash script.

How to use this image

Examples:

# Pull the image from Docker Hub:
docker pull cloudunder/java-runtime:7

# Print the version and exit:
docker run --rm cloudunder/java-runtime:7 java -version

A sample Dockerfile for a Play Framework application:

FROM cloudunder/java-runtime:openjdk8

WORKDIR /app
COPY target/universal/stage/ .
EXPOSE 9000
CMD ["bin/appname"]

Containerise the Play app:

# Compile the app in stage mode
# In your Play app's directory:
./activator stage

# Build a container with the app
docker build -t yourappimagename .

Run the Play app in the Docker container:

# To make web application accessible with a random port:
docker run -P -t yourappimagename

# To bind public port 80 to the app's port 9000:
docker run -p 80:9000 -t yourappimagename

Now you should be able to open the app in your browser.

Docker Pull Command
Owner
cloudunder