Introduction to Docker

Welcome to the first part of this series. To understand rest of the series it’s essential to know the basics of Docker. So let’s get started.

Docker is an open platform for developing, shipping, and running applications.

Docker provides a way to run almost any application securely isolated in a container. The isolation and security allow you to run many containers simultaneously on your host. The lightweight nature of containers, which run without the extra load of a hypervisor, means you can get more out of your hardware.

These are the reasons it’s preferred platform for micro-services based applications.

Docker is based on the concept of Linux containers let’s have a look at Linux containers.

Linux containers

In a normal virtualized environment, one or more virtual machines run on top of a physical machine using a hypervisor like Xen, Hyper-V etc. Containers, on the other hand, run in user space on top of operating systems kernel.

It can be called as OS level virtualization. Each container will have its isolated user space and you can run multiple containers on a host, each having its own user space. It means you can run different Linux systems (containers) on a single host.

However you cannot run a windows container on a Linux host because there is no Linux Kernel support for windows.

Containers are isolated in a host using the two Linux kernel features called namespaces and control groups.

Namespaces

There are six namespaces in Linux (pid, mnt, ipc, net, usr, uts). Using these namespaces a container can have its own network interfaces, IP address etc. Each container will have its own namespace and the processes running inside that namespace will not have any privileges outside its namespace.

Control groups

The resources used by a container is managed by Linux control groups. You can decide on how much CPU and memory resource a container should use using Linux control groups.

Container is not a new concept. Google has been using their own container technology in their Infrastructure for years. Solaris Zones, BSD jails, LXC are the few Linux container technology that has been around for years.

Docker is basically a container engine which uses the Linux Kernel features like namespaces and control groups to create containers on top of an operating system and automates application deployment on the container. It provides and lightweight environment to run your application code.

To learn more about docker refer https://docs.docker.com/engine/understanding-docker/

Series NavigationContainers Basics >>

Leave a Reply