Java Technologies And Frameworks
8 min readAug 22, 2022

Docker |Docker Architecture |Docker work flow|what is docker ?why docker ?How to install WSL2 on windows? How to install docker on windows? create an account on docker hub

Topics discussed here :

  1. What is virtual machine?
  2. Advantages of Virtual machine.
  3. Disadvantages of Virtual machine.
  4. The Key differences between container and virtual machines.
  5. what is Containerization?
  6. What is Docker ?
  7. Why use Docker?
  8. Benefits of Docker container.
  9. Docker Architecture.
  10. Typical Docker work Flow
  11. How to install Docker on windows Operating System.

Before discussing about docker one must know about virtual machine.

Lets quickly discuss here

1.what is virtual machine?

A virtual machine is the virtualization/emulation of a computer system. It runs on top of an emulating software called the hypervisor. The hypervisor is the key to enable virtualization. It manages and allows the sharing, partitioning of physical resources of CPU into among multiple operating systems or independent program. Each virtual machine runs its own guest operating system.

2.Advantages of Virtual machine

  • VMs can run multiple operating system environments on a single physical computer, saving physical space, time and management costs.
  • Virtual machines support legacy applications, reducing the cost of migrating to a new operating system. For example, a Linux VM where the guest OS is Linux can able to exist where the host OS is windows OS.

3.Disadvantages of Virtual machine

. Running multiple virtual machines on one physical machine can result in unstable and slower performance.

. Each virtual machine having independent guest operating system.

4.The Key differences between container and virtual machines

  • >Virtual machine virtualizes the system singular resource like RAM, CPU, Disk, or Networking and represented as multiple resources where as containers only virtualize software layers above the operating system level.
  • Applications running on VM system can run different OS. While applications running in a container environment share a single OS.
  • VM virtualizes the computer system. While containers virtualize the operating system only.
  • VM size is very large. While the size of container is very light i.e. a few megabytes.
  • VM takes minutes to run, due to large size. While containers take a few seconds to run.
  • VM uses a lot of system memory. While containers require very less memory.
  • VM is more secure. While containers are less secure.
  • VM’s are useful when we require all of OS resources to run various applications. While containers are useful when we are required to maximize the running applications using minimal servers.
  • Examples of VM are: KVM, Xen, VMware. While examples of containers are: RancherOS, PhotonOS, Containers by Docker.

5.what is Containerization?

  • Containerization is operating system-level virtualization or application-level virtualization over multiple network resources where software applications can run in isolated user spaces called containers .It packages applications as images that contain everything needed to run the application : code, runtime environment, libraries, and configuration.
  • Container share the common operating system of physical server.

6.what is a container ?

  • A container is a software unit that packages up code and all its dependencies so the application runs quickly and reliably from one environment to another environment. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

6.What is Docker ?

Docker is a container to package the application along with all the dependencies , libraries and ship it as a single package and container . For that Docker engine is required to run docker container .
Now the code will work on each environment like development , QA, UAT and prod environment.

7.Why use Docker?

  • Docker is used for Virtualization in order to have multiple Operating systems running on the same host which is an abstracted the environment where it is running actually and provides better utilization of computer resources irrespective of environment dependencies.
  • Docker is the client-server type of application where clients who relay to the server system.
  • Docker images are the “source code” for our containers; we use them to build we can say a template . You can have multiple containers (copies) of the same image.
  • Dockerfile has two types of registries 1.) public and 2)private registries
  • Containers are the organizational units of Docker volume. Docker hub is a library and community for container images.

8.Benefits of Docker container.

  1. There is no dependency version mismatch from one environment to another environment.
  2. No need to worry about library corrupted ex :tomcat jars , available in in development but corrupted in UAT environment
  3. Easy for Software upgradation from environment to another environment.

9.Docker Architecture

  • lets discuss about docker main components here

Docker Engine : where our docker images are running.

Host operating system is the operating system where our docker engine is relying on our physical server.

Docker images : images are the source code for container.

Docker registries : where the docker images are stored. docker company has public registries call docker hub.

10. Typical Docker work Flow

  • write docker file
  • using docker command , will create a docker image means a skeleton of our application.
  • docker container is nothing but the running instance of our docker image.
  • docker image we need to keep it in docker hub like a repository ,how are you getting the dependencies from maven central repository and similarly we are getting the docker image from docker hub .
  • from docker hub both staging server and production server will get the docker image .
  • this will gives no version mismatch and jar mismatch and dependencies mismatch

11.How to Install Docker on Windows Operating System.

How to Install Docker in windows home and windows pro

  • Before installing docker , first we need to find out the windows operating system type whether it is windows 10 Home or windows 10 Pro.
  • To find out your system type,
  • Click on windows icon, search “system info“,
  • Click on “system information
  • Check on your "OS Name” to see your system type.

Step 1: System Requirements to Install Docker on Windows Home

These are the computer requirements to install docker on windows home

  • Windows 10 64bit, version 1903 or higher.
  • 4GB system RAM
  • In addition to the system requirements above, you also need to install WSL2 and activate virtualization on your computer.

Step 2: Enable Virtualization & WSL2 on your windows Home computer

What is WSL?

WSL Stands for Windows Subsystem for Linux. What exactly does it do?

  • It integrates Linux into native windows without the need to use an external virtual machine.
  • It allows you to run native linux applications like Ubuntu and Debian on Windows
  • It allows you to use install and run docker on windows home edition, and more things
  • Basically, it gives you access to linux system using a windows machine.

The following things are need to enable in our System to install and use docker.

  • Virtual Machine Platform
  • Windows Subsystem for Linux (WSL2)
  • BIOS-level hardware virtualization enabled.

Click on windows icon → search for “Turn windows features on or off” —> click on it —> select “Virtual machine platform” and “Windows subsystem for linux“, click OK.

You will need to re-boot your computer after this step.

NOTE: The above instructions installs WSL but NOT WSL2 which is what you need for docker.

again to install WSL2 below system configuration is required :

  • Windows 10 or Above
  • For x64 systems: Version 1903 or higher, with Build 18362 or higher.
  • For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
  • Builds lower than 18362 do not support WSL 2.
  • to verify our system is running on hyper -V or not , Go to windows icon -> search system information. In last we will notice hypervisor

to verify using the command prompt -> open command line type “systeminfo”->scroll down and check Hyper-V

The default windows sub system for Linux need to upgrade to WSL2

How you upgrade your WSL system to WSL2 is a little different if you are on Intel x64 system or ARM64 system.

If you are on Intel x64 computer, download this → WSL2 Linux kernel update package for x64 machines

If you are on ARM64 computer, download this → ARM64 Package.

then install the upgrade package and restart the system.

The WSL2 is the key to install Docker on windows operating system

Step 3: Install Docker on Windows Home and Windows Pro Computer

first download the docker for windows using the link below

https://docs.docker.com/desktop/install/windows-install/

double click on installer which is downloaded and follow the installation steps next finish.

After installing docker , it doesn’t start automatically. search for docker desktop and click on app.

  • After clicking on the app, you will see the docker icon on the windows status bar. If you don’t see it, click on the up arrow and you should see it.
  • When the docker icon stops blinking, then docker stabilized and is ready to use.
  • When you finish using docker, be sure to right-click the docker icon on the status bar, and click on quit, to quit the docker engine.
  • If you close docker without stopping the engine, the engine will continue to run in the background until you right-click the icon to quit the docker engine.
  • To verify the docker is installed or not> open command line type ->docker -v.

How to create an account in docker hub.