Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Oracle Java on Docker

Build a Docker image containing Oracle Java (Server JRE specifically).

The Oracle Java Server JRE provides the same features as Oracle Java JDK commonly required for Server-side Applications (i.e. Java EE application servers). For more information about Server JRE, visit the Understanding the Server JRE blog entry from the Java Product Management team.

Just to clarify these Docker build scripts are unofficial Oracle Build scripts. See Oracle Docker images on GitHub for the official Oracle Docker build scripts.

Since the image is used as base image for Oracle Unified Directory it will also add a few common unix package. In particular the following additional packages including there dependencies will be installed: * libaio Linux-native asynchronous I/O access library * tar A GNU file archiving program * gzip The GNU data compression program

Java 8

Download Server JRE 8 .tar.gz file and drop it inside folder java-8. If you download Java 1.8 with the latest update from MOS (see Doc ID 1439822.1), make sure to first unzip the p<PATCHID>_180<UPDATE>_Linux-x86-64.zip file. This Dockerfile expects the Java package in the form server-jre-8u<UPDATE>-linux-x64.tar.gz.

Build it:

$ cd java-8
$ docker build -t oracle/serverjre:8 .

Alternatively you may use the shell script build.sh to build the docker images. The script does check if a server JRE package (server-jre-8u<UPDATE>-linux-x64.tar.gz) is available. Otherwise it either tries to fallback to a local Java patch package (eg. p<PATCHID>_180<UPDATE>_Linux-x86-64.zip) or download the Java patch package from MOS using curl. Since you have to be logged in to MOS, curl needs a .netrc file with the MOS credentials.

Build with a local server-jre-8u<UPDATE>-linux-x64.tar.gz or p<PATCHID>_180<UPDATE>_Linux-x86-64.zip file:

$ cd java-8
$ ./build.sh

Create a .netrc file containing the credentials for login.oracle.com to automatically download the Java patch package before building the docker image:

    $ cd java-8
    $ echo "machine login.oracle.com login <MOS_USER> password <MOS_PASSWORD>" >.netrc
    $ ./build.sh
    $ rm .netrc

License

To download and run Oracle Java, regardless whether inside or outside a Docker container, you must download the binaries from the Oracle website and accept the license indicated at that page.