Running WebLogic 12.2.1 on Docker

It’s a sign of the times when Oracle mention that the latest version (12.2.1) of their Oracle WebLogic Java EE Application Server was released last week on Docker shortly before it was released as a plain old executable installer.

But before you get too excited, let me just say one thing. If you were hoping to run something like this:

docker run -d oracle/weblogic:12.2.1

…and then, voilà! …you might be a tad bit underwhelmed.

Now don’t get me wrong, you can run WebLogic 12.2.1 on Docker containers and it works well, some might say very well. All of the WebLogic Server features are available in the container AND… you’ve got the added portability and flexibility that Docker brings. There is however, dare I say, more hoops to jump through in the initial setup then you’ve come to expect from the Docker experience. Let me explain.

As anyone who is familiar with Docker knows, running a container is as simple as docker run. Basically, this one command will search locally for the docker image and if not found, it will securely pull it down from the internet. Then, it will start it up in seconds (or less), ready for accepting requests. Simple right?!

The user experience built by Docker around the existing Linux container technology is basically one of the many reasons Docker containers are becoming increasingly popular. But more so, if DevOps and Continuous Delivery is about eliminating wasteful activities in order to innovate faster, Docker-based containers is a good example of this. When it comes to Docker, the value-added time seems to be pretty close to the elapsed-time.

As I mentioned earlier, Docker will run any container for you with a single command. Or, if you’re the rock-dwelling type that doesn’t believe me, go try it for yourself. Execute docker run tomcat:8.0 and then in seconds after the initial download, the Tomcat web server will be running and accessible from a browser. Pretty cool huh?

With Oracle WebLogic Server on Docker theres a bit more of ‘dem hoops I spoke about earlier.

  1. Sign up for an Oracle account at their website (if you don’t already have one)

  2. Download the JDK and Oracle WebLogic Server installers from their website. You’ll need to be logged in with your Oracle account.

  3. Install Git then run git clone https://github.com/oracle/docker.git https://github.com/oracle/docker-images.git
    Edit: As mentioned by Bruno Borges on our older blog website, the Oracle Docker git repository URL was changed. Also, if you are really against Git for some reason you can download the whole source as a zip file instead from https://github.com/oracle/docker-images/archive/master.zip and avoid having to use Git at all.

  4. Now, place the previously downloaded binaries in the following locations:

    • OracleWebLogic/dockerfiles/12.2.1/fmw_12.2.1.0.0_wls_quick.jar
      (you’ll have to extract this from the zip file first)
    • OracleWebLogic/dockerfiles/12.2.1/jdk-8u60-linux-x64.rpm
      .
  5. Build the Docker image from scratch. The script does a docker build under the covers but also does some validation of the installation binaries against the md5sum records.
    sudo sh buildDockerImage.sh -v 12.2.1 -d
    Note: Checksums for container images are already built into Docker but that’s not quite the “Oracle way” because they require you to download install files and build your own images.

  6. Now it’s time to create a second image for our running instance based on the previous WebLogic 12.2.1 binary Docker image that we built. Simply navigate to the OracleWebLogic/samples/1221-domain directory and rename Dockerfile.empty or Dockerfile.supplementaldomain to Dockerfile.
    I suspect the reason Oracle wants you to rename it is because they are simply providing a template. While it does actually work out of the box, you may want to customise your platform; like adding a data source or some JMS messaging configuration etc.

  7. Run the following from the sample directory as in the previous step to build our WebLogic Server instance Docker image. This will perform all the automated steps defined in the Dockerfile.
    sudo docker build -t oracle/weblogic:12.2.1 .

  8. Almost there… Now it’s time to boot up the container.
    sudo docker run -d --name=wlsadmin oracle/weblogic:12.2.1

  9. Give it some seconds and then there you have it. Oracle WebLogic Server 12.2.1 running in a container with the Admin Console ready to use.
    To get the container IP address run docker inspect wlsadmin | grep IPA. You can use this to then access the WebLogic console on
    http://container-ip:8001/console
    If you’re wondering about WebLogic Managed Servers and how to add them, there are some details at https://github.com/oracle/docker/tree/master/OracleWebLogic and in the Oracle Whitepaper.

So what’s the lesson in all of this? Is it that the WebLogic and Docker relationship is a match made in heaven? Not quite. But, it’s a step in the right direction. I’m sure many new Docker users will come out of the Oracle woodworks just because of Oracle’s decision to start “certifying” some of their products on Docker.

Oracle WebLogic on Docker is great. But before you can get running there is 9 coarse grained steps and probably 3 times that when you factor in the fine grained steps (basically, 27 steps). Why did Oracle do this, when it could have been one step? Well I don’t know for sure… but my jocular take is that they’re implicitly inspiring a new powerful metric to DevOps and of course, pioneers aren’t going to like it… This new metric will help us to factor in the unfortunate time that will be lost signing End User Licence Agreements (EULA). Or, as I like to call it:

Legally-binding Added Time Extensions or L.A.T.E. as it so makes you. As we brace for the new wave of enterprise container users. Perhaps we need to think about what a new enterprise DevOps pipeline might look like. Maybe:

  1. Sign the EULA (manually)
  2. Login securely and download the software. (manually)
  3. Mess around with Git to build your vendor-endorsed application server container image from scratch. (manually)
  4. Profit!

All jokes aside, I predict with the recent announcement of containers coming to Oracle Cloud – You can bet there will be a publicly available Docker registry for Oracle software coming soon which would turn 27 steps to essentially one. But don’t expect it to be the public Docker Hub registry. You know how it is…

Happy Dockering! And please leave any comments if you need assistance troubleshooting Docker running on WebLogic 12.2.1.

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

Subscribe to Oracle PaaS, Oracle Middleware and DevOps

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!