• Wed. Nov 20th, 2024

Docker

What is Docker?

Docker is a container management service. The keywords of Docker are develop, ship and run anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere.

Virtual machines (VMs)
Docker container

While traditional hardware virtualization is based on launching multiple guest systems on a common host system, Docker applications are run as isolated processes on the same system with the help of containers. The biggest differences between the two are in terms of resource consumption and portability.

Containerization and Virtualization

Virtualization is the technique of importing a Guest operating system on top of a Host operating system. This technique allows developers to run multiple operating systems in different virtual machines all running on the same host. This eliminated the need for extra hardware resource.

Advantage

  • Multiple operating systems can run on the same machine
  • Maintenance and Recovery were easy in case of failure conditions
  • Total cost of ownership was also less due to the reduced need for infrastructure

Dis Advantage

  • Running multiple Virtual Machines leads to unstable performance
  • Hypervisors are not as efficient as the host operating system
  • Boot up process is long and takes time

Containerization

Containerization is the technique of bringing virtualization to the operating system level. While Virtualization brings abstraction to the hardware, Containerization brings abstraction to the operating system. Containerization is however more efficient because there is no guest OS here and utilizes a host’s operating system, share relevant libraries 6 resources as and when needed unlike virtual machines.

Application specific binaries and libraries of containers run on the host kernel, which makes processing and execution very fast.

Advantage

  • Containers on the same OS kernel are lighter and smaller
  • Better resource utilization compared to VMs
  • Boot-up process is short and takes few seconds

Dis Advantage

  • To use Docker with Windows or OS X, you actually have to use a VM or Hypervisor to get access to a Linux kernel to provide containers.
  • However, unlike VM’s, You cant use multiple operating systems and kernels for each container.

Example for Docker

Assume that an application which has been written both in Ruby and Python. To avoid any version conflicts on user’s a Linux docker container can be created with the required versions of Ruby and Python installed along with the application. Now the end users can use the application easily by running this container without worrying about the dependencies or any version conflicts.

Components of Docker

Docker Engine   — It is used for building Docker images (application) and creating Docker containers.

Docker Hub      — This is the registry which is used to host various Docker images.

Docker Compose – This is used to define applications using multiple Docker containers.

Installation

Docker runs basically in interacting with Linux Kernal for containerization. Docker execution is smoother with Linux environment and could be run via Virtual Box or Hypervisor enabled on Windows 10 operating system. Lets have a short introduction on installation via both medium.

Installing Docker on Ubuntu

Step 1

Before installing Docker, make sure right version of Linux Kernal is installed.

uname -a

Step 2

Update the OS to latest packages.

sudo apt-get update

Step 3

Some “ca” certificates needs to be installed and this shall be done via below commands,

sudo apt-get install apt-transport-https ca-certificates

Step 4

New CPG key needs to installed,

sudo apt-get install gnupg

Step 5

Adding the repository of Docker Image to docker.list for download,

echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list

Step 6

Upgrade OS package in order to make sure of upto date

sudo apt-get update

Step 7

Now execute the downloaded package for installing Docker

sudo apt-get install docker-ce	or sudo apt-get install -y docker-engine

Step 8

To verify the package manager points to right repository, issue an apt-cache command,

apt-cache madison docker-ce  or	apt-cache policy docker-ce	or	apt-cache policy docker-engine

Step 9

Validate the installation by executing the Docker Version running,

docker version

Step 10

To get more information on Docker running on system,

docker info
Bookmark (1)

No account yet? Register

Views: 44

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x