Introduction to Docker
Dear Readers,
In this article,we will see Introduction to Docker.
What is Docker?
Docker is an open source tool that uses containers to create, deploy, and manage distributed applications.
Docker is a tool which is used to create virtual machines.
Using docker we can create any number of containers.
Docker is a tool that performs operation system level virtualization.
It is also known as “containerization”.
It was first released in 2013 and was developed by Docker.
Docker is tool used to create virtual machines called ‘containers’.
Took from shipping containers.
Docker is a tool designed to make containers in which we can deploy any type of applications easily.
Docker uses union file system (layered).
Docker performs OS level virtualization.
What is a Virtual Machine?
Virtual Machine is a software that emulates a computer system.
A virtual machine is a system which acts exactly like a computer.
This enables teams to run what appear to be multiple machines on a single computer. If you need to run software on a different type of hardware or operating system, a VM provides that option without using additional hardware.
The operating systems and their corresponding applications utilize the same hardware resources that originate from either a single-host server.
Each VM needs an underlying operating system with virtualized hardware.
VMs run on top of a physical machine using a “hypervisor”. A hypervisor, in turn, runs on either a host machine or on “bare-metal”
A hypervisor is computer software, hardware, or firmware placed in between the virtual machine and its hardware.
A computer that allows the hypervisor to run a single or more than one virtual machine is known as the host machine, and all the virtual machines are called guest machines.
The most popular products on the market are VMWare and VirtualBox.
Benefits of VMs
All OS resources available to apps
Established management tools
Established security tools
Better known security controls
Popular VM Providers
VMware vSphere
VirtualBox
Xen
Hyper-V
KVM
What Are Containers?
Container is considered a new method that can replace virtualization.
An operating system can operate many applications from the cloud. Instead of virtualizing the computer as with VM, containers virtualize the OS.
Containers are placed on a physical server and host OS.
Shared components are read-only.
Every container shares kernel, binaries, and libraries with their host OS.
These shared components are available only as read-only, so there is no need to reproduce operating system codes.
The server will be able to run a lot of workloads in just one OS installation.
Types of Containers
Linux Containers (LXC) — The original Linux container technology is Linux Containers, commonly known as LXC. LXC is a Linux operating system level virtualization method for running multiple isolated Linux systems on a single host.
Docker — Docker started as a project to build single-application LXC containers, introducing several changes to LXC that make containers more portable and flexible to use. It later morphed into its own container runtime environment. At a high level, Docker is a Linux utility that can efficiently create, ship, and run containers.
Benefits of Containers
Reduced IT management resources
Reduced size of snapshots
Quicker spinning up apps
Reduced & simplified security updates
Less code to transfer, migrate, upload workloads
Popular Container Providers
Linux Containers
LXC
LXD
CGManager
Docker
Windows Server Containers
Differences between Virtual Machine Vs Container
Virtual Machine | Docker Container |
Heavyweight | Lightweight |
Limited performance | Native performance |
Each VM runs in its own OS | All containers share the host OS |
Hardware-level virtualization | OS virtualization |
Startup time in minutes | Startup time in milliseconds |
Allocates required memory | Requires less memory space |
Ready-made VMs are difficult to find | Pre-built docker containers are easily available |
Pre Allocation of RAM | No pre Allocation of RAM |
More resource usage | Less resource usage |
Hardware-level process isolation | OS level process isolation |
Creating VM takes a relatively longer time | Containers can be created in seconds |
VMs can move to new host easily | Containers are destroyed and re-created rather than moving |
Docker Benefits
Containerization is a OS level virtualization (No need guest OS).
No pre allocation of RAM.
Can replicate same environment.
Less cost.
Less weight.
Can run on physical/virtual/cloud.
Can reuse (same image).
Can create machines in less time.
Docker Features
Although Docker provides lots of features, we are listing some major features which are given below.
Easy and Faster Configuration
Increase productivity
Application Isolation
Swarm
Routing Mesh
Services
Security Management
Easy and Faster Configuration
This is a key feature of docker that helps us to configure the system easily and faster.
We can deploy our code in less time and effort. As Docker can be used in a wide variety of environments, the requirements of the infrastructure are no longer linked with the environment of the application.
Increase productivity
By easing technical configuration and rapid deployment of application. No doubt it has increase productivity. Docker not only helps to execute the application in isolated environment but also it has reduced the resources.
Application Isolation
It provides containers that are used to run applications in isolation environment. Each container is independent to another and allows us to execute any kind of application.
Swarm
It is a clustering and scheduling tool for Docker containers. Swarm uses the Docker API as its front end, which helps us to use various tools to control it. It also helps us to control a cluster of Docker hosts as a single virtual host. It’s a self-organizing group of engines that is used to enable pluggable backends.
Routing Mesh
It routes the incoming requests for published ports on available nodes to an active container. This feature enables the connection even if there is no task is running on the node.
Services
Services is a list of tasks that lets us specify the state of the container inside a cluster. Each task represents one instance of a container that should be running and Swarm schedules them across nodes.
Security Management
It allows us to save secrets into the swarm itself and then choose to give services access to certain secrets.
It includes some important commands to the engine like secret inspect, secret create etc.
Docker Architecture
Docker follows client-server architecture. Its architecture consists mainly three parts.
Client
Docker_Host
Registry
Client
Docker provides Command Line Interface (CLI) tools to client to interact with Docker daemon. Client can build, run and stop application. Client can also interact to Docker_Host remotely.
Docker_Host
It contains Containers, Images, and Docker daemon. It provides complete environment to execute and run your application.
Registry
It is global repository of images. You can access and use these images to run your application in Docker environment.
What is Docker engine?
Docker engine or Docker is a client-server application that builds and executes containers using Docker components.
It is the core part of the whole Docker system. Docker Engine is an application which follows client-server architecture.
It is installed on the host machine.
There are three components in the Docker Engine:
Server: It is the docker daemon called dockerd. It can create and manage docker images. Containers, networks, etc.
Rest API: It is used to instruct docker daemon what to do.
Command Line Interface (CLI): It is a client which is used to enter docker commands.
Docker Components
Docker Image
Contains OS (very small) and software’s ,It almost negligible.
Docker Container
Container like a machine which is created from Docker Image.
Docker File
Describes steps to create a Docker Image.
Docker Hub/Registry
Store all docker images publicly.
Docker Daemon
Docker Service.
Ways to create Docker Images
Take image from Docker Hub.
Create image from existing docker containers.
Create image from dockerfile.
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform