Zero to WebLogic in 5 Minutes!

Did you know that you can integrate the Oracle Container Registry and Container Cloud to rapidly deliver a WebLogic environment?

In this post, I will show you how it is done in 3 easy steps.
1. Integrate the Registry with Oracle Container Cloud
2. Spin up a WebLogic Stack on the Cloud
3. Access your Cloud-based instance

Firstly make sure you have an Oracle account and are signed into container-registry.oracle.com. You will need to accept the terms and restrictions as I mention in my previous article.

Once you have accepted the terms, you will have 8 hours to download the images you need from within your Oracle Container Cloud Service instance.

Step 1: Integrate the Registry and Container Cloud

From the Oracle Container Cloud Service:
1. Go to Registries then New Registry.
2. Enter your account details for Oracle Container Registry.
3. To test your credentials, you can click Validate.
4. When you are ready, click Save.

Once we have added the Registry to the Oracle Container Cloud, we can now easily spin up Oracle WebLogic instances.

Step 2: Spin up a WebLogic Stack on Cloud

Before we can spin up our stack, we need to tell Oracle Container Cloud which Docker image we want to create our containers from so that it starts the correct version of WebLogic.

To find the appropriate image, from the Oracle Container Registry:
1. Click on Middleware under Business Area.
2. Then, click on weblogic under Explore Official Repositories.
3. The default image name is shown in the top right hand corner. For WebLogic it is container-registry.oracle.com/middleware/weblogic.

If you want to download the latest version of WebLogic, you can simply use the default image name. However, if you want to download a specific image version you will need to specify a tag in the image name you provide to the Oracle Container Cloud. Tags are appended to the image name with colon (:). For example, if we wanted Oracle WebLogic 12.2.1.2 we would specify the image as container-registry.oracle.com/middleware/weblogic:12.2.1.2.

The full list of available tags are shown under the Tags tab.

If you omit the tag in the image name it defaults to latest which is why container-registry.oracle.com/middleware/weblogic will give you the latest version. You should not use latest for production as it may lead to unpredictable behaviour such as unintended upgrades.

Let's get our instance up and running.

  1. Go to Stack then Quick Start Wizard.
  2. Choose your Resource Pool. If you are evaluating the Container Cloud, I would recommend sticking to the default Resource Pool. Click Next.
  3. Copy and paste your docker run snippet and click Add. In our example, we will use docker run -d -p 7001:7001 container-registry.oracle.com/middleware/weblogic:12.2.1.2 which says to map 7001 in the container to 7001 in the host and to use WebLogic 12.2.1.2. If you do not add a port mapping you will not be able to access your instance from a public IP address.
  4. Click Next.
  5. Enter a name for your stack and click Launch.

Your Docker image will be downloaded and booted in a few minutes.

Step 3: Access your WebLogic Stack

To access your stack, click on the Hostname for your container.

Next, copy the public IP address to your clipboard.

With this public IP address you can access your WebLogic Admin Console from a web browser at http://PUBLIC_IP:7001/console

To login as the default weblogic admin user, you will first need to obtain the randomly generated password.
Click on Container then select the Name of the container.
Then click to View Logs
At the top of the logs, on the second line, it will show what the randomly generated password is.

Bonus Points: Port your container anywhere!

As Docker containers are infinitely portable, you can port your instance anywhere that Docker is installed; including your local machine. To do this, copy your Stack YAML and paste in into a file called docker-compose.yml.

Now, on any machine where docker and docker-compose is installed you can simply do this:
1. docker login. Enter your Registry account details.
2. docker-compose up -d
3. Access the WebLogic Admin Console from a web browser at http://YOUR_IP:7001/console

Good luck and Happy Shipping!

Craig Barr

I am a Software Engineer with a decade of experience empowering Enterprises in Banking, Logistics, Manufacturing with Service-Oriented Architecture, Microservices and Cloud Computing.

Brisbane, Australia https://twitter.com/craigbarrau