DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes

Trending

  • The Truth About AI and Job Loss
  • Understanding the Shift: Why Companies Are Migrating From MongoDB to Aerospike Database?
  • Code Reviews: Building an AI-Powered GitHub Integration
  • The Perfection Trap: Rethinking Parkinson's Law for Modern Engineering Teams
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. WebLogic on Docker Containers Series — Part 1

WebLogic on Docker Containers Series — Part 1

This is the first post in my WebLogic on Docker Containers Series. Read on to learn how to get started with WebLogic on Docker.

By 
Bruno Borges user avatar
Bruno Borges
·
Jan. 10, 16 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
12.5K Views

Join the DZone community and get the full member experience.

Join For Free

WebLogic 12.2.1 is certified to run Java EE 7 applications, supports Java SE 8 (since 12.1.3), and can be deployed on top of Docker containers. It also supports Multitenancy through the use of Partitions in the domain, enabling you to add another level of density to your environment. Undeniably, WebLogic is such a great option for Java EE based deployments that both developers and operations will benefit from it. Even Adam Bien, Java EE Rockstar, has agreed.

But you are here to play with WebLogic and Docker, so first, check these links about the certification and support:

  • [Whitepaper] Oracle WebLogic Server on Docker Containers
  • [Blog] WebLogic 12.2.1 Running on Docker Containers
  • Dockerfiles, Scripts, and Samples on GitHub
  • Docker Support Statement on MOS Doc.ID 2017645.1
  • Oracle Fusion Middleware Certification Pages

Understanding WebLogic on Docker

We recommend our customers and users build their own image containing WebLogic and Oracle JDK installed without any domain configured, perhaps a second image containing a basic domain. This is to guarantee easier reuse between DevOps teams. Let me describe an example: Ops would provide a base WebLogic image to Dev team, either with or without a pre-configured domain with a set of predefined shell scripts, and Devs would perform domain configuration and application deployment. Then Ops get a new image back and just run containers out of that image. It is a good approach, but certainly customers are free to think out of the box here and figure out what works best for them.

TL;DR

Alright, alright... Do the following:

1. Download docker-images' master.zip file repository directly and drop somewhere.

$ unzip master.zip && mv docker-images-master docker-images

2. Download WebLogic 12.2.1 for Developers and Oracle JDK 8 specific versions as indicated in Checksum.developer. Put them inside dockerfiles/12.2.1 folder. You will see placeholders there (*.download files).

3. Build the installation image

$ cd docker-images/OracleWebLogic/dockerfiles
$ sh buildDockerImage.sh -d -v 12.2.1

4. Build the WebLogic Domain image

$ cd ../samples/1221-domain
$ docker build -t 1221-domain .

5. Run WebLogic from a Docker container

$ docker run -d -p 8001:8001 1221-domain

6. Access Admin Console from your browser: http://localhost:8001/console

Note that these steps are for your first image build only. Customers are encouraged to run a Docker Registry at their internal network, and store these images there just as they probably already do with Oracle software installers at some intranet FTP server. Important! Do not share binaries (either packed as a Docker image or not).

* follow this series if you want to learn more of WebLogic on Docker. But please do read the entire post... :-)

Creating Your First WebLogic Docker Image

The very first step to get started, is to checkout the docker-images project on GitHub:

$ git checkout --depth=1 https://github.com/oracle/docker-images.git

If you don't have or don't want to install the Git client, you can download the ZIP file containing the repository and extract it. Use your browser, or some CLI tool.

Another thing to know before building your image is that WebLogic comes in two flavors: one is the Developer distribution, smaller, and the other is the Generic distribution, for use in any environment. For the developer distribution, you have to download two files indicated inside Checksum.developer. If you want to build the Generic distribution instead of the Developer, see file Checksum.generic for further instructions, but tl;dr, you need two files again (or one if you have downloaded JDK already). The same instructions apply.

  • Oracle WebLogic 12.2.1 Quick Installer for Developers (211MB)
  • Oracle JDK 8u65 Linux x64 RPM (or latest as indicated in the Checksum file)

Next step is to go to the terminal again and use the handy shell script buildDockerImage.sh, which will do some checks (like checksum) and select the proper Dockerfile (either .developer or .generic) for the specific version you want, although I do recommend you start with 12.2.1 from now on.

$ cd docker-images/OracleWebLogic/dockerfiles
$ sh buildDockerImage.sh -d -v 12.2.1

You may notice that it takes some time to copy files during the installation process. That's because WebLogic for Developers is compressed with pack200 to be a small download. But after you build this image, you can easily create any domain image on top of it, and you can also share your customized image using docker save/load. Next step is to create a WebLogic Domain.

Creating the WebLogic Domain Image

So far, you have an image that is based on Oracle Linux 7 and has WebLogic 12.2.1 for Developers and Oracle JDK installed. To run WebLogic, you must have a domain. Luckily WebLogic is mature enough to be very handy for DevOps operations, and has support for a scripting tool called WLST (you guessed: WebLogic Scripting Tool), based on Jython (Python for Java) that allows you to script any task that you'd perform through a wizard or the web interface, from installation to configuration to management to monitoring. I've shared some samples on the GitHub project and I'll cover a couple of them in this series of WebLogic on Docker, but for now, let's just create the basic, empty WebLogic Domain.

Go to the samples folder and access folder 1221-domain. When there, just simply perform:

$ cd docker-images/OracleWebLogic/samples/1221-domain
$ docker build -t 1221-domain .

This process is very fast, at least for this sample. Time may vary if your WLST for creating a domain performs more tasks. See the sample create-wls-domain.py to get some ideas.

Starting WebLogic on Docker

You now have the image 1221-domain ready to be used. All you need to do is to call:

$ docker run -ti -p 8001:8001 1221-domain

And, now you can access the Admin Console on http://localhost:8001/console.

Frequently Asked Questions, Part 1

Q: Can I write my own Dockerfiles and WLST scripts to install and create WebLogic?

A: Absolutely! That is the entire idea of sharing these scripts. These are excellent pointers on what can be done, and how. But customers and users are free to come up with their own files. And if you have some interesting approach to share, please send to me at bruno dot borges at oracle dot com.

Q: Why is WebLogic Admin on port 8001 instead of default 7001?

A: Well, it is a sample. It is to show what configurations you can do. The environment variable ADMIN_PORT, as well other configurations in the samples/1221-domain/Dockerfile are picked up by the create-wls-domain.py script while creating the domain. The WLST script will even use some defaults if these variables are not defined. Again, it's a sample.

Q: What if I need to patch the WebLogic install?

A: You do that by defining a new Dockerfile and apply the patch as part of the build process, to create a new base image version. Then you recreate your domain image that extends the new patched base image. You may also want to simply extend your existing domain image, apply the patch, and use that one, or you can also modify your image by applying the patch in some existing container, then committing the container to a new image. There are different ways to do that, but for sure applying the patch to a live container is not one of them, since it is a good idea to keep containers as disposable as possible, and you should also have an image from where you can create new patched containers.

Q: What if I want a WebLogic cluster with Node Manager and Manged Servers?

A: That works too. I'll cover that in this series.

Q: Can I build a Docker image with a deployed artifact?

A: Yes. More on that in upcoming blog posts of this series.

Q: Can I have a Load Balancer in front of a Swarm of Docker containers?

 A: Yes. That will also be covered as part of this series.

I hope you are excited to learn more about WebLogic on Docker.
So, please follow this blog and my Twitter account for upcoming posts.

Docker (software)

Published at DZone with permission of Bruno Borges. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Scaling Microservices With Docker and Kubernetes on Production
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!