/oracle-weblogic-apple-arm64-docker-image

An unofficial workaround to run Oracle WebLogic server in an arm64-native container

Primary LanguageDockerfile

How to run Oracle WebLogic Server on Apple M1 (arm64 processor family) without x86 emulation

logo Although considered not compatible on Apple M1 (arm64) CPU architecture by Oracle itself, WebLogic server DOES work on ARM-based processor family (remember the "write once, run everywhere" slogan?).

In this repo we will try to document the procedure followed at Sunnyvale to have a containerised WebLogic running on the MacBook Pro with M1 processor (for testing purpose only); hoping this will help other JavaEE developers equipped with Apple M1 processor or with any other ARM-based PC.

This procedure references WebLogic 12.2.1.4 (which it has been tested against) but can be use as a starting point to obtain the same for WebLogic 14.x.

Disclaimer

WebLogic server is not officially supported on Apple M1 or on any other ARM-based architecture.

The source code contained in this repo as well as this WebLogic installation procedure and its usage, do not belong to and are not supported/endorsed by Oracle or any of its subsidiaries.

You have to be entitled to download and run WebLogic as well as the Oracle JDK.

Oracle and Apple logos are properties of their respective owners.

Create the arm64 WebLogic base image

The arm64 WebLogic base image creation is split in two phases:

  • get prerequisite softwares
  • build the image

Get an arm64 JDK tar.gz distribution

An arm64 JDK tar.gz distribution can be obtained from Oracle website at https://www.oracle.com/java/technologies/downloads/.

Be aware that JDK version must be compatible with the WebLogic version you want to use, ie: WebLogic 12.2.1.4 requires JDK version 8.

Pay attention to download the ARM version of the Oracle JDK

Having downloaded the arm64 JDK tar.gz distribution, put the archive in the current folder.

Get WebLogic software

Unfortunately, the WebLogic installer does not support the arm64 architecture, so we can not rely on it to install WebLogic on an Oracle Linux base image.

Having said this, the right thing to do is to obtain an already-installed WebLogic installation directory; we can get it from a standard WebLogic baseimage for the x86 architecture.

The command below starts an x86 WebLogic 12.2.1.4 container and copy the installation directory in the current path of host machine.

$ docker run \
    --platform linux/amd64 \
    -v $(pwd):/mnt/tmp \
    --rm \
    -ti \
    container-registry.oracle.com/middleware/weblogic:12.2.1.4 \
    cp -r /u01/oracle /mnt/tmp

This may take a while due to the x86 instructionset emulation, just wait for the container to complete its job.

Build the arm64 WebLogic base image

To build the WebLogic base image for arm64 architecture we can leverage the Dockerfile provided by this repo.

In the example below, we are building a WLS 12.2.1.4 base image with Oracle JDK package jdk-8u202-linux-arm64-vfp-hflt.tar.gz

$ docker build \
    --build-arg JDK_PKG=jdk-8u202-linux-arm64-vfp-hflt.tar.gz \
    -t sunnyvaleit/oracle-weblogic:12.2.1.4-java8 \
    .

Run an arm64 WebLogic container

Since this documentation is not meant to substitute the Oracle's official one but just to provide a way to build an arm64 WebLogic base image, the way you can run a container for local JavaEE development is better described by Oracle itself, for example following those two tutorials:

By running a container of Application Deployment WebLogic image, you finally have a running arm64-native WebLogic instance locally with your application deployed.