Step 5: Create a WebLogic Domain

Yay! This is the moment we’ve been waiting for. We’ve created all of the images needed to run WebLogic now we’re ready to create a containerized domain with a running admin server.

 

Start the Admin Server

To start a containerized admin server run the following docker command:

 

This docker run statement starts the container in the background using the 1221-domain image we created earlier. The -p 8001:8001 acts as a port forwarder, allowing us to access the admin server running on port 8001 inside the container over port 8001.

 

You can then use ‘docker attach’ or ‘docker logs’ to view the container’s stdout.

 

 

Once the admin server is running, you can then use your browser to connect to the container at http://localhost:8001/console

Create a Managed Server

Oracle has provided us with a helper script for creating a managed server.  Keep in mind the Docker architecture for running WebLogic specifies that each WebLogic process runs in its own container. The admin server is running in its own container.

To launch a managed server we will create another instance of a container image using a script provided by Oracle.

 

Once that command returns, view the logs for the new container. You can see the output from the createServer.sh script – merely WLST for creating a managed server instance. Be sure to replace my container ID with your container ID.

Be sure to replace my container ID with your container ID.

The Docker command above will create another container linked to our ‘wlsadmin’ container and then execute the createServer.sh script. If you take a look at the contents of this script, it essentially runs two WLST scripts. One creates a WebLogic machine and the other creates a managed server.

Let’s see what Docker processes are running:

 

 

You can see from this output that we have two Docker processes running. The bottom one show in my output is the admin server (noted by startWebLgoic.sh as the command), and the top one is the managed server we set out to create using the createServer.sh script.

Now let’s check out the admin console and verify our managed server is up and running.

 

WebLogic Admin Console running in Docker

 

Shutdown Everything Down

 

To shut down your running containers, Oracle has provided a helper script that will go through and remove all your running containers.

 

Run docker ps to confirm that all the containers are shut down.

 

 

Wrapping Up

 

Over these 5 steps, I showed you how to create docker images for Oracle JRE and Oracle WebLogic using the dockerfiles from Oracle’s GitHub repo. I also launched an admin server and created a managed server using the samples from Oracle again.

 

The samples from Oracle serve as a great starting point for your organization. You should spend some time and snoop around their dockerfiles and samples. Customize them for your needs.  In particular, I recommend checking out the multi-host docker image which can be used to deploy Weblogic across multiple machines – which is a more realistic operational scenario than the single-host scenario I presented in this article.

Step 5: Create a WebLogic Domain
Tagged on:     
Show Buttons
Hide Buttons