Introduction to Docker and Docker Compose

Aim- What is Docker and Docker Compose. I will try to explain about linux container then goes more into Docker and Docker Compose for a beginner.

Now in this cloud buzz world, what developers want –

● Scalability, maintainability, Agility, Portability.
● DevOps tools.
● Improved resource utilization.
● A continuum of abstraction levels.

Linux Containers -contain applications in a way that keep them isolated from the host system that they run on. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. And they are designed to make it easier to provide a consistent experience as developers and system administrators move code from development environments into production in a fast and replicable way.
In a way, containers behave like a virtual machine. To the outside world, they can look like their own complete system. But unlike a virtual machine, rather than creating a whole virtual operating system, containers don’t need to replicate an entire operating system, only the individual components they need in order to operate. This gives a significant performance boost and reduces the size of the application. They also operate much faster, as unlike traditional virtualization the process is essentially running natively on its host, just with an additional layer of protection around it

Linux Containers
● Use Linux kernel isolation features to give a VM like environment.
● Process isolation /Sandboxing.
● Example: Lxc, lmctfy, Docker.

Now, What is Docker
● An easy to use Linux container technology.
● Docker image format.
● It helps in application packaging and delivery.

Docker is a tool that can package an application and its dependencies in a virtual container that can run on any Linux server. This helps enable flexibility and portability on where the application can run, whether on-premises, public cloud, private cloud, bare metal, etc. (Wikipedia)


Docker Vs Virtualization-

– Docker is lighter than virtual machines.
– The size of Docker images is very small compared.
– We can run more Docker container on a reasonably sized host.
– Deploying and scaling is relatively easy.
– Docker has less start up time.

Technologies behind docker
● Control groups:
○ Control Groups are another key component of Linux Containers
○ With Cgroup we can implement resource accounting and limit.
○ Ensure that each container gets its fair share of memory, CPU, disk I/O.
○ Thanks to Cgroup, we can make sure that single container cannot bring the system down by exhausting resources.

● Union file systems: ○ Layered file system so you can have a read only part and a write part, and merge those together. ○ Docker images made up with are layers.

● Namespaces
○ It helps to create an isolated workspace for each process.
○ When you run a container, Docker creates a set of namespaces for that container.
● SELinux
○ SELinux provides secure separation of containers by applying SELinux policy and labels.

What are components of Dockers

Docker Images – An image is an inert, immutable, file that’s essentially a snapshot of a container. Images are created with the build command, and they’ll produce a container when started with a run. Images are stored in a Docker registry such as registry.hub.docker.com
Docker containers – is an open source software development platform. Its main benefit is to package applications in “containers,” allowing them to be portable to any system running the Linux operating system
Docker Hub – is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts
Docker Registry -is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts
Docker daemon -This is the part which does rest of the magic and knows how to talk to the kernel, makes the system calls to create, operate and manage containers, which we as users of Docker dont have to worry about.
Docker client – This is the utility we use when we run any docker commands e.g. docker run (Docker container run), Docker images, docker ps etc. It allows us to run these commands which a human can easily understand.

docker

As you see above screen shot, we have docker client where the user performs build, pull and run operation.The client interacts with a host which contains different container, Docker Daemon and images via Registry.

If you guy reading this line, then you must be getting something about docker now. You know basic components and vocabulary.
Now let’s take an example of real life applications.
● One application consists of multiple containers.
● One container is dependent on another.
● Mutual dependency/ startup order.
● Process involves building containers and then deploy them
● Long docker run commands
● Complexity is proportional to the number of containers involved

dockerwithMultiContainer

Take example of above image, this will look multicontainer docker .The containers include (1) NGINX container, (3) Tomcat containers, (1) MongoDB container, and (1) ELK container. But have’t docker came to help us, This look quite difficult process to manage it all. To rescue us, Docker Compose is there.

Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application’s services. Then, using a single command, you create and start all the services from your configuration.Compose is great for development, testing, and staging environments, as well as CI workflows.

compose

Docker Compose
● Tool for defining and running multi-container Docker application.It is a YML file and compose contains information about how to build the containers and deploy containers. It is integrated with Docker Swarm. It competes with Kubernetes.

Compose is basically a three-step process.

1- Define your app’s environment with a Dockerfile so it can be reproduced anywhere.
2- Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment.
3- Lastly, run docker-compose up and Compose will start and run your entire app.

docker-yml

You can explore more with Docker Swarm, which I will explain in next post. Till then happy learning with Vinay

Querying data in elastic search

Hi All,

A common issue in elastic search as querying data from ES server. As typical RDBMS server, we can write like

“select * from tablename where columnA is null”

Similarly, if we have to find this data in ES in kibana , then how we can write it

It will be like

GET IndexName/TypeName/_search
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "object_desc"
}
}
}
}
}

Similarly we can write this in java API ES 2.2 as below

QueryBuilder query = QueryBuilders.boolQuery()
.mustNot(QueryBuilders.existsQuery("object_desc"));

Client client = getClient();
SearchResponse response = client.prepareSearch(indexName)
.setTypes(type)
.setSearchType(SearchType.QUERY_AND_FETCH)
.setQuery(query)
.setFrom(0)
.setSize(10000)
.setExplain(false)
.execute()
.actionGet();
SearchHit[] searchHits = response.getHits().getHits();

ES query API is quite good and you can test in kibana console.

Happy searching with techartifact…

Beginning Oracle WebCenter Portal 12c book– Published!!

15027775_1265334893487331_5199818658147986314_n

bookbb

This book is intended for beginners,expert and software architects, project manager , who are working with WebCenter Portal implementation.Somebody wants to developer rich enterprise portal with WebCenter Portal with WebCenter content and other technologies. Little bit ADF knowledge required.

http://www.apress.com/gp/book/9781484225318

amazon

Chapter 1 : Introduction to Enterprise Portals – Introduction of Enterprise portal. Portal vs website and introduction of Oracle FMW.

Chapter 2 : Introduction to Oracle WebCenter Portal 12c – First chapter to talk about WebCenter portal. Architecture of portal, Main components of WebCenter Portal.New Features and deprecated features of WebCenter portal 12c.

Chapter 3 : Oracle WebCenter Portal12c Administration – How to do administration of WebCenter Portal. Normal task for WebCenter Portal administrator. etc.

Chapter 4 : Portal Asset Development – How to set developer environment for Portal Asset development.How to portal asset publishing.How to develop portal asset runtime.

Chapter 5 : Working with Pages and Navigation – What Is a Page? Working with System and business Pages. how to Working with Personal and portal Pages,Rendering a Portal Navigation.

Chapter 6 : Extend Portal with Shared Libraries– What Are Shared Libraries? You will learn how to deploy nd develop WebCenter Portal Shared Library.explains Development Life Cycle with example.

Chapter 7 : WebCenter Portal Task Flow Customization– Overview of customization, How to do taskflow customization on design and run time.Setting Up a Customizable WebCenter Portal Application. Customizing WebCenter Portal Task Flows of Design Time Customization,Deployment of Customized WebCenter Portal Task Flow.

Chapter 8 : Portlets Integration Using JSR 286 – What is portlet, What is use of it. Learn when to use portlet and taskflow. Learn to create Portlet. How to convert adf taskflow into portlet.Build JSR 286 portlet and deploy in WCP.

Chapter 9 : Creating Pagelet Producer – Learn about Pagelet Producer Architecture.Creating Pagelet Producer Resource .Pagelets in WebCenter Portal.How to add content in pagelet using Web Injector.Know how to add pagelet using javascript and REST API.

Chapter 10 : Portal Security Administration – Learn Security Architecture.Understanding WebCenter Portal Security.Using Enterprise Manager for Security Administration UI,learn Using of WebCenter Portal Security Administration UI.Securing Page Components.

Chapter 11 : Content Integration – Learn to integrate WebCenter Content,Publishing Content via WebCenter Content Integration,Learn Integration with Oracle Document Cloud. Publishing Content Using Pages,Publishing Content Using Data Presenter,Publishing Content: Blogs nd wikis.

Chapter 12 : Portal Tools and Services – Learn Webcenter portal Analytics,Announcements and Discussions,External Applications. Learn on how to work on Events, Instant Messaging and Presence, links, list, mail,People connections, Notes, Notification, RSS, search and tags.

Chapter 13 : Extending WebCenter Portal – Learn how to integrate WebCenter Portal with all third party application for example, EBS, OBIEE etc. Learn how to use portal REST API and WebCenter Portal Java API.

So now horn up your ADF skills to learn WebCenter Portal.

Happy Learning with Vinay….