Testing

Windows 10 WSL 2, Docker and Oracle – a perfect Partnership

I admit it, I was not a friend of Oracle databases running in Docker containers for a long time. My database systems for testing and demo purposes were all running in VMware, Virtual Box or in the Oracle Cloud. But I have used the Windows Subsystem for Linux since beginning, to work with the Oracle Oracle Cloud Infrastructure CLI, Git Integration etc.. And what I really like is the WSL extension for Visual Studio Code which gives me to chance, to edit Ansible Vault files in Windows without any additional Linux based VM running.

With the update of the existing Windows Subsystem for Linux (WSL) architecture to version 2, the Docker Desktop for Windows is now fully integrated and able to run Docker container in WSL as a lightweight VM. Now it’s time to change my mind, why not use Docker to try out new Oracle features, do some development stuff and more?

What to we need to run Oracle databases in WSL 2 Docker Containers?

  1. WSL 2
  2. Docker Desktop for Windows
  3. Docker images with an Oracle Database – I may use the images (oehrlis/docker) from my workmate Stefan Oehrli (oradba.ch)- merci vöumou

This blog post shows you how to setup WSL 2 to run Docker images. Sure, you can use the Oracle provided Docker images or self created images too. But I have verified the Oracle repository today, the Dockerfile version is 19.3.0. And I don’t have the passion, to create new Dockerfiles for example to run 19.8 and download additional RU software.

Installing Windows Subsystem 2 for Linux

Enable Windows Subsystem for Linux basic Functionality

Start Windows PowerShell as Administrator and enable WSL.

Do not restart Windows 10 at the moment.

Activate Windows Subsystem for Linux 2

Check your version before enabling WSL 2, the criteria from the install document must be meet – for example for my x64 platform:

  • Running Windows 10, updated to version 1903 or higher, Build 18362 or higher for x64 systems.

Let’s check it with Windows logo key + R and winver – my version us 1904:

Enable the ‘Virtual Machine Platform’ – this component is required for WSL 2.

Restart the Windows machine. Now wsl.exe is available as command in Power Shell.

Set WSL 2 as default when installing Linux distributions from Microsoft Store like Ubuntu and SLES.

 

 

Getting Windows 10 ready for Docker

Install Docker Desktop for Windows

Run the Docker Desktop Installer executable. Let the checkboxes activated.

Two minutes later.

Start Docker and verify the Availability

After starting the Docker Desktop, you get a notification that Docker is starting. Docker is recognising that WSL is installed.

Docker is now ready to use.

Open a new PowerShell as Administrator and verify if docker and docker-compose are available.

Install Git

Link: https://git-scm.com/download/win

We use Git to checkout the Oracle docker containers later. There are several Git clients for Windows available. I use the one from git-scm.com. Just run the executable. After the successful installation, verify Git availability in PowerShell.

Go for the Oracle Database

Startup the Oracle Docker Image

Before cloning of the Git repository, I created a new directory in my Workplace folder.

Clone Docker Image Repository

The content of my cloned directory Oracle Database 19.0.0.0.

We use Docker Compose here, this makes it very easy to handle networking stuff like port forwarding. Example content of the docker-compose.yml file. In this case, I have not configured the Docker Volume Base, the files for the container are created in a subfolder of the clone directory.

After pulling, let’s start the container with docker-compose.

In the background, the database will be created and configured – example output in Docker Desktop.

SQL Developer Connect

Verify in the Shell if the Oracle database and the listener are running – example output from the Trivadis Toolbox component TVD-Basenv.

Summary

The integration of Docker in Windows Subsystem for Linux is fast and easy to configure. I like the idea to run a lightweight VM inside my existing WSL. In future, before I think about to start a VMware or Virtual Box VM to do some Oracle testing stuff, I will verify if there is Docker image available. And I will definitely spend more time to discover the possibilities of Docker 🙂

Do you need a Mailserver for Testing Purposes? Communigate Pro!

When I am testing Oracle and other software, I want to verify functions like sending alert mails. On Linux systems it’s easy. The most distributions have packages like sendmail already preconfigured and ready to use. But for example on Windows systems, there is no built-in solution. The goal was to have a small virtual machine running as mailserver which can be used for all my test cases.

CommuniGate Pro

CommuniGate Pro is a groupware which supports a lot of solutions like SMTP, POP3, Webmail and many more. In this post I describe how you can easy install the software and configure the SMTP component in Oracle Enterprise Linux 6.

The goal is to use CommuniGate Pro for the Enterprise Manager 13c to send mail alerts. Note: If you want to use CommunigatePro in your company, then you have to license it.

Software Download

The Software is available for the most platforms here: http://www.communigate.com/main/purchase/download.html
Link to the installations guides: https://www.communigate.com/communigatepro/Install.html

Installation

I use the rpm file which I have already transferred to my server olten.trivadistraining.com into directory /tmp. The installation has to be done as user root.

The software is now installed in directory /opt

The installation routine creates the runlevel startup script that the software will be started automatically during server boot.

If you have already mail solutions like sendmail or postfix up and running, you have to stop and disable it.

Oracle Linux 6 – Stop postfix

Oracle Linux 6 –  Stop Sendmail

Start CommuniGate Pro

You can a) reboot your server or b) start it manually:

Web Access Configuration – Step by Step

Initial Configuration: https://www.communigate.com/communigatepro/Install.html#Config
Quick Start: https://www.communigate.com/communigatepro/QuickStart.html

When the server is started, you can now access the web GUI by server URL and Port 8010.

Step 1 – Master Password

Set master password for user postmaster – I agree.

communigate_01

Step 2 – Server Name and Interface Mode

Verify server name and language, set interface mode to Advanced –  Update.

communigate_02

Step 3 – Create Account

Tab Users – insert new account name –  Create Account.

communigate_03

Step 4  – Set Real Name and Password

Set the Real Name and the CommuniGate Password for the new created user – Update.

communigate_04

Step 5 – Add Client IP

In tab Settings – Network – Client IPs add your client ip address or address range – Update.

communigate_05

Configure Client – for Example Oracle Enterprise Manager 13c

Set Host, User Name and PasswordOK.

communigate_06

Now you will receive the messages from EM13c.

 

communigate_07

Troubleshooting

With telnet you can verify if the correct SMTP service is running on port 25 and if the firewall is open.

Wrong Service

Right Service

Summary

Communigate Pro offers you an easy to configure SMTP platform. I have configured a small virtual machine which I start whenever I want to test some email functions.

Sure, this software can do much more. But all I want is to send emails from my test servers – Mission accomplished!