In this article I am going to show you how to create a Docker image for installing WebLogic. Note this is for the installation of the WebLogic product binaries only. We will create another docker image for deploying a domain.
Before you can build the Oracle WebLogic Docker image, be sure you created the Oracle JRE 8 image!
Download Oracle WebLogic 12c
As with building the Oracle JRE 8 image, we first need to download the installation package for Oracle WebLogic server. In this article, we are going to use the developer version which is a smaller distribution than the generic version of the installer.
Instructions for downloading Oracle WebLogic and building the image can be found under docker-images/OracleWebLgoic/README.md.
Once you have downloaded the Quick Install Developer Edition 126.96.36.199 from Oracle, copy it to appropriate directory per the README.md file: docker-images/OracleWebLogic/dockerfiles/12.2.1
Notice how Oracle has a directory per version of Weblogic. You can build docker images for each version first by downloading that version from Oracle.com and then building its image.
Build the Docker Image
To build a docker image for Oracle WebLogic 12.2.1, run the provided build script under docker-images/OracleWebLogic/dockerfiles.
Running the script with the -h flag shows you all the helper options you can specify.
$ ./buildDockerImage.sh -h
Usage: buildDockerImage.sh -v [version] [-d | -g | -i] [-s] [-c]
Builds a Docker Image for Oracle WebLogic.
-v: version to build. Required.
Choose one of: 12.1.3 12.2.1 188.8.131.52 184.108.40.206
-d: creates image based on 'developer' distribution
-g: creates image based on 'generic' distribution
-i: creates image based on 'infrastructure' distribution
-c: enables Docker image layer cache during build
-s: skips the MD5 check of packages
* select one distribution only: -d, -g, or -i
To build a 12.2.1 developer image, we need to specify the version and distribution.
$ ./buildDockerImage.sh -v 12.2.1 -d
Executing this command will take some time. You should see from the output that the WebLogic image uses the Oracle JRE 8 image we built earlier.
Once the build is complete, verify the image was created.
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle/weblogic 12.2.1-developer 8f5708ba2680 About an hour ago 1.18 GB
oracle/serverjre 8 b18ec85a7cbe 2 hours ago 382.2 MB
oraclelinux latest 27a5201e554e 3 weeks ago 225.1 MB
hello-world latest c54a2cc56cbb 6 months ago 1.848 kB
In the next article we will create yet another docker image for the actual WebLogic domain itself. Step 4: Build the Domain Image.