Oracle WebLogic container images stored on docker hub are deprecated. Oracle moved these on his own container registry: https://container-registry.oracle.com/

This registry contains many Oracle products, but we will focus on WebLogic in this blog.

Prerequisites

To be able to pull an image, you must be sign in and accept the license of the image.

The license agreement is per image product (or repository as they called, but it might be confusing). Before you accept, it will look like that:

WebLogic License Agreement Pending

Note that Oracle also provides patched version of the images with latest CPU. I will go for the standard one.

To accept license, click on Continue button and read “Oracle Standard Terms and Restrictions”, then you can accept. After that, repository line will look like this:

WebLogic License Agreement Accepted

Login

Before pulling the image, I have to log into the registry:

$ docker login container-registry.oracle.com
Username: <[email protected]>
Password:
WARNING! Your password will be stored unencrypted in /home/ols/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
$

Tags

Before pulling the image, let’s see how tagging is done. Tags will allow you to select among many types of container images provided by Oracle:

  • WebLogic server version: 14.1.1, 12.2.1.4, 12.2.1.3, …
  • Java version: 11.0.17, 8u351, …
  • Linux version: Oracle Linux 7u9, 8u4, …
  • Installation type: Generic, Slim, Developer

Almost all of these could be combined to obtain the perfect image that fit your needs and constraints. Oracle even provides a nice table view with search capabilities and the associated pull command:

Pulling

Let’s download image of the tag 14.1.1.0-11-ol8:

$ docker pull container-registry.oracle.com/middleware/weblogic:14.1.1.0-11-ol8
14.1.1.0-11-ol8: Pulling from middleware/weblogic
65da81875cb9: Pull complete
91a7039d5d86: Pull complete
1bd80e398fe0: Pull complete
a3367028d133: Pull complete
7d59a6e587a1: Pull complete
48b74505173e: Pull complete
Digest: sha256:9b9032fb01aa88c381fd49f0c029289f2b1db21b4e92793ed410c3e3064909f8
Status: Downloaded newer image for container-registry.oracle.com/middleware/weblogic:14.1.1.0-11-ol8
container-registry.oracle.com/middleware/weblogic:14.1.1.0-11-ol8
$ 

Note that if license was not accepted, it will fail like if I was not logged in (I took Oracle Unified Directory as example):

Error response from daemon: pull access denied for container-registry.oracle.com/middleware/oud, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Usage of Image

To be able to start this image, I need at least to set a WebLogic console administrator. To do that, I must create a domain.properties file with following content:

username=weblogic
password=********

And map current directory to /u01/oracle/properties when starting the container:

$ docker run -d -p 7001:7001 -p 9002:9002 \
      -v $PWD:/u01/oracle/properties \
      container-registry.oracle.com/middleware/weblogic:14.1.1.0-11-ol8

It will take a few minutes as domain is being created. Use docker logs to check status:

$ docker logs -f zealous_gagarin
Domain Home is:  /u01/oracle/user_projects/domains/base_domain
Create Domain

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

domain_name                 : [base_domain]
admin_listen_port           : [7001]
domain_path                 : [/u01/oracle/user_projects/domains/base_domain]
production_mode             : [prod]
admin name                  : [AdminServer]
administration_port_enabled : [true]
administration_port         : [9002]

After a minute, you can see that it is started:

...
<Apr 13, 2023, 7:47:57,260 AM Coordinated Universal Time> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in production mode.>
<Apr 13, 2023, 7:47:57,291 AM Coordinated Universal Time> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<Apr 13, 2023, 7:47:57,328 AM Coordinated Universal Time> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.

Image Customizations

This will bring up an empty domain without any managed server or deployed web application. Oracle suggests extending images with a Dockerfile. Here is how it could look like:

FROM container-registry.oracle.com/middleware/weblogic:14.1.1.0-11-ol8
COPY --chown=oracle:root container-scripts/* /u01/oracle/
WORKDIR /u01/oracle
RUN ["/u01/oracle/createAndStartEmptyDomain.sh"]

createAndStartEmptyDomain.sh is embedded in the image, but it could be extended with customization.