Sunday, May 21, 2017

1. Learning dockerization for WebLogic on Oracle Linux in Vagrant

Writing this blog post after couple of executions experiments and research on docker. The basic requirement for docker is there must be a Linux/Unix based platform. Here I am creating that one on my Windows host machine, and the guest Ubuntu Trusty64 platform with the help of Vagrant and Oracle Virtualbox provider.

vagrant Ubuntu docker - Oracle Linux images

In this Article I am not dicuss about from the scratch What is docker etc. I'm not talking about Virtualization vs Containerization.
Create testnode1 folder on the Windows machine. I've created on F:\testnode1.

The Vagrantfile to launch Ubuntu Trusty64 Virtual machine is as follows:

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.define "test" do |testnode1|
 testnode1.vm.box = "williamyeh/ubuntu-trusty64-docker"
 testnode1.vm.hostname="testnode1.vybhava.com"
 testnode1.vm.network "private_network", ip: "192.168.33.102"
  end
  config.vm.synced_folder "F:/Softwares", "/u01/app/software"
  config.vm.provider "virtualbox" do |vb|
     vb.memory = "4096"
   end
 end

After Vagrant up looks like this

In the Trusty64 terminal the createuser.sh shell script will be executed first time. Next time onwards it will verify and shows message already executed.

Note that this vagrant box built-in with docker, and when you start the box it will automatically brings up the docker-engine.

How do I know docker installed?


Using docker info you will get to know about the docker version, status and information about daemon how much memory, CPU are allotted for it.

docker info
The docker info command execution


How do I check docker engine running?


Using regular Linux service command will tell about docker engine. Of-course docker info already tells the same in one of the line.

service docker status

Checking docker service status


Lets do dockerization

There are multiple docker commands which help you to create docker images, pull them from the global repository. Docker images will be used to generate docker containers. Here image is like blueprint and the container is like object of the blueprint.

docker search oraclelinux

docker search for oraclelinux image in public registry

Once you found your desired image then you can use pull command on docker engine then docker image will be visible.

docker pull oraclelinux7

docker pull oraclelinux-7
After pull successful your docker images stack will be updated to check use docker images command.

docker images

docker images list including oraclelinux-7
Running docker container
We can run the docker container from the pulled images, here we are interested on oraclelinux-7 image.


 docker run -i -t --name orawls --hostname orawls.vybhava.com dnraikes/oraclelinux-7:latest /bin/bash

Next post on Java WebLogic in docker image

4 comments:

Blurb about this blog

Blurb about this blog

Essential Middleware Administration takes in-depth look at the fundamental relationship between Middleware and Operating Environment such as Solaris or Linux, HP-UX. Scope of this blog is associated with beginner or an experienced Middleware Team members, Middleware developer, Middleware Architects, you will be able to apply any of these automation scripts which are takeaways, because they are generalized it is like ready to use. Most of the experimented scripts are implemented in production environments.
You have any ideas for Contributing to a Middleware Admin? mail to me wlatechtrainer@gmail.com
QK7QN6U9ZST6