Public | Automated Build

Last pushed: 12 days ago
Short Description
The smallest Docker image with OracleJDK 8 (167MB)
Full Description

OracleJDK 8 Docker image

This image is based on Alpine Linux image, which is only a 5MB image, and contains
OracleJDK 8.

You must accept the
Oracle Binary Code License Agreement for Java SE
to use this image (see #6 for details).

JDK bundle contains lots of unnecessary for Docker image stuff, so it was cleaned up. There are 3
tags: full (only src tarballs get removed), cleaned (desktop parts get cleaned), slim
(everything but compiler and jvm is removed). master branch refers to slim tag, but latest
tag points to cleaned.

slim (master branch) download image size is:

cleaned (latest tag) download image size is:

full download image size is:

Consider using develar/java image (~120MB) if you only need JRE (you can run
java applications, but cannot build/compile them).

Usage Example

$ echo 'public class Main { public static void main(String[] args) { System.out.println("Hello World"); } }' > Main.java
$ docker run --rm -v "$(pwd)":/mnt --workdir /mnt frolvlad/alpine-oraclejdk8:slim sh -c "javac Main.java && java Main"

Once you have run this command you will get printed 'Hello World' from Java!

Docker Pull Command
Owner
frolvlad
Source Repository

Comments (11)
thatsk
5 months ago

whats the differenence between when i use openjdk as compared to oraclejdk
because my container size is 129 MB

frolvlad
6 months ago

I have added some new tags!

Please, create issues on Github if you have any questions because e-mail notifications for comments are broken (don't work at all) on Docker Hub!

derfunk
7 months ago

I agree with what mateuszkarbowymyob says - this would make using your image more universal to people who want to have the version number fixed.

mateuszkarbowymyob
7 months ago

It would be great if you could create a tag that has a locked OS and JDK version, like 3.5-8.121.13 so we could lock our code with that specific tag without risking it getting updated to the newer version of these.

gianrubio
a year ago

To solve "Failed to load native library 'libnative-platform.so' for Linux amd64."

add this lib
RUN apk update && apk add libstdc++ && rm -rf /var/cache/apk/*

frolvlad
2 years ago

Please, create issues on Github if you have any questions because e-mail notifications for comments are broken (don't work at all) on Docker Hub!

olliefreeman
2 years ago

This is just what i'm after however installed Gradle onto it gives the following error Failed to load native library 'libnative-platform.so' for Linux amd64. Best I can find anywhere is that this is a glib issue...any help or advice would be appreciated

topfdrummer
2 years ago

great work! exactly what i was looking for :)

frolvlad
2 years ago

@lamielle I've faced that DNS-related issue with Apache Spark and fixed it in my image. I'm not sure whether it is a bug of Oracle Java or Apache Spark, but I solved it by creating /etc/nsswitch.conf and now it works fine for me.

frolvlad
3 years ago

@lamielle I use glibc packages, described in this github issue: https://github.com/gliderlabs/docker-alpine/issues/11