##Google Analz## ##Microsoft## ##Googel## Swanand: 2020

Thursday 13 February 2020

Docker Introduction

docker 

Docker

So, the thing is that before understanding docker, we need to understand some well-known concepts like virtualization and hypervisors.
For that, let us look the pictorial representation of three and learn layer by layer.
virtualization vs hypervisor vs docker
From the picture above, it must be crystal clear that in case of:
  1. Virtualization: It runs on top of the host Operating System.
  2. Hypervisor: It runs on top of hardware, also known as bare-metal virtualization.
  3. Docker: It also run on the top of host OS but there is a small difference in this.
Question: So, If docker also runs on the top of the host Operating System, how is it different from virtualization?
Answer: In case of virtualization, each machine created whether it is a Windows, or Linux or macOS, or any other operating system, will install its own kernel and hence,
number of virtual machines = number of the kernel running in an isolated environment

Virtualization vs Docker

virtualization vs docker
The picture above shows some key differences between virtualization and docker:
  1. Hardware = It rarely matters, 99% of times no difference at all.
  2. Host OS = Any OS can be used for the both, but because of some reasons, Linux suits best for docker.
  3. Images = It can be seen, that the size of an image is very big in case of virtualization as compared to the other.
  4. Storage = After the start, during running state as well, the size of virtual machines are again big as compared to Docker containers.
  5. Boot Time = Again, the boot time of virtual machines are very large, whereas docker containers runs very fast, in seconds.
Question: Why docker is best suited on Linux?
Answer: The reason behind this is that the docker’s main application/utility utilizes the OS’s kernel for its task/job completion.
Question: What is actual meaning of the answer given above?
Answer: It mean that the containers created under docker application are kernel-less and they use native Host OS’s kernel to perform tasks, that is why containers are efficient, fast, small and portable.
Question: What are some different names of docker?
Answer: They are following:
  1. Container Based Virtualization
  2. OS Level Virtualization
  3. Lightweight Virtualization
  4. Microservices

Virtual Machines vs Docker Containers

Virtual Machines vs Docker Containers
Virtual Machines = Guest OS + Binaries/Libraries + Application’s code
Docker Containers = Binaries/Libraries + Application’s code
There is a small yet big difference between containers and virtual machines and that is the Guest OS layer.
As discussed above, containers use Host OS’s kernel but virtual machines need their own native kernel in order to perform tasks.
Note: Docker containers run as isolated user-space process under Host OS via sharing its kernel.
Note: Docker containers are nothing but applications/code packed with their dependencies.
Question: So, apart from all the above discussed, what is the main purpose behind using docker and its containers?
Answer: An application packed with its dependencies can be transported to test environment, to development environment, to production environment without worrying about any kind of error.

Scenario

Before Docker = An application’s code is written and compiled, when the application is tested and executed on developer’s computer/laptop and it requirements (dependencies are > mysql5 and php6), but when the same compiled code is sent to tester and tried to run “it eventually fails”, from here the problem begins.
Problem = Tester was unable to figure out the root cause of the error, so the developer is told to recheck the code, the code is rechecked and it is again running without errors on developer’s machine, but when resent to tester, the problem persists.
Root Cause = The root cause is nothing but dependency problem, i.e. the version of mysql and php being used on tester’s machine is different from that of developer’s machine, mysql5 + php6 on developer’s machine but on tester’s machine, it is mysql3 + php4.
Comment = It may look like a small problem on this scale, but in real-time production environment it may result is drastic problems.
Solution = Docker Containers, it is the only way to remove such problem, because containers are packed applications with their dependencies.

Convert the PEM files to a PPK files using PuttyGen

This post demonstrates how to convert private key .pem files generated and downloaded from AWS when creating an EC2 instance to .ppk files that are supported by putty.exe for SSH access.

PuttyGen

PuttyGen is an application that can convert .pem files to .ppk files. You may download it from the URL below.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html


Scroll down until you reach the portion of the page that has the direct download links to the puttygen.exe.
You may choose to download 32-bit or 64-bit depending on your machine architecture.
 

 

Conversion Process

1. Run puttygen.exe

Double-click the .exe file on the file system. It then displays the following.
Click the Load button.

2. Choose your .pem file to convert

Initially you won’t see the .pem file. To fix this, choose All Files (*.*).
Choose the file and click Open.

3. Save private key

Click Save private key.
Then an message dialog window appears. For demonstration purposes, simply click Yes.
Save the file with .ppk extension.

Use .ppk in Putty.exe

Run putty.exe. Go to Connection -> SSH -> Auth.

User name and IP Address

To connect to your EC2 via Putty, specify the following. You IP address may differ from mine.
The IP address is from the EC2 Instance Description tab:
You’ll see this on your putty when you successfully logged in to your EC2 instance.

Featured post

Vicidial With WebRTC

Vicidial With WebRTC VICIDial is well known open source call center software. It has been in use by many small to large scaled con...