Docker And How to Install It on Windows 10

What is Docker?

 

Docker is an open-source centralized platform designed to create, deploy, and run applications.

What is Container?

The concept of containerization is an approach in which the application, its dependencies and configuration are all packed in a single file known as a container.

Containers are kind of similar to a Virtual Machine, but instead of running whole OS and all its services, they only run bare minimum required by the software packed as a container and depend on host OS for the most part. These containers have better performance than running a complete Virtual Machine and are isolated from the host OS environment.

What is Virtual Machine?

A virtual machine is a software that allows us to install and use other operating systems (Windows, Linux, and Debian) simultaneously on our machine. The operating system in which virtual machine runs are called virtualized operating systems. These virtualized operating systems can run programs and preforms tasks that we perform in a real operating system.

Containers And Virtual Machine

Containers Virtual Machine
Integration in a container is faster and cheap. Integration in virtual is slow and costly.
No wastage of memory. Wastage of memory.
It uses the same kernel, but different distribution. It uses multiple independent operating systems.

Why Docker?

Docker allows us to easily install and run software without worrying about setup or dependencies.

Developers use Docker to eliminate machine problems.

Operators use Docker to run and manage apps in isolated containers for better compute density.

Enterprises use Docker to securely built agile software delivery pipelines to ship new application features faster and more securely.

Since docker is not only used for the deployment, but it is also a great platform for development, that’s why we can efficiently increase our customer’s satisfaction.

Advantages of Docker

There are the following advantages of Docker

  • It uses less memory.
  • It runs the container in seconds instead of minutes.
  • It provides lightweight virtualization.
  • It does not require full operating system to run applications.
  • It uses application dependencies to reduce the risk.
  • Docker allows you to use a remote repository to share your container with others.
  • It provides continuous deployment and testing environment.

How to install and run Docker with WSL backends on a Windows 10 PC

  • You need Windows 10 64-bit Pro, Enterprise or Education edition with 1703 update or later for using Windows 10 64-bit with 2004 update or later for WSL backend. Aside from this, a modern 64-bit processor with virtualization support and a minimum 4 GB of ram is required.
  • In addition to the above requirements, you need virtualization support enabled in the BIOS. To check if you already have virtualization enabled, open the Task Manager and go to the Performance tab.

  • If the virtualization is shown as ‘Disabled’, you will need to enable it in BIOS settings.

 

Download and Install Docker Manually

If you want to install Docker the manual way, head on over to the Docker Desktop downloads page and then click on ‘Download for Windows (Stable)’ button to download the installer file.

Then, go to your download folder and double click on ‘Docker Desktop Installer’ setup file to initiate the installation process.

You will be presented with a configuration window in the setup process. Tick ‘Enable WSL 2 Windows Features’ if you are on Windows 10 Home edition or want to use Docker’s WSL 2 backend and Tick ‘Add shortcut to desktop’ if you want Docker Desktop shortcut, then press ‘Ok’ to begin the installation.

Once the Docker Desktop setup finished unpacking and installing the files, click on the ‘Close and restart’ button to complete the docker installation process.

Enable WSL

Windows Subsystem for Linux (WSL) is a compatibility layer which allows users to run Linux application natively on Windows 10. The Docker WSL backend allows users to run native Linux Docker containers on Windows without Hyper-V emulation.

If you have the latest Windows 10 2004 update, then it is recommended to use the WSL as Docker backend. The Windows 10 Home edition users have no other option than using the WSL backend for Docker as Home edition don’t have Hyper-V feature.

Update WSL

After you have Completed the Docker Installation and restarted the system, when you run the Docker Desktop you will see an error as shown below.

               

Click on this link or link in the error to go to Microsoft Docs page with the latest WSL2 kernel update. Then click on ‘download the latest WSL2 Linux kernel’ link on the page as shown below to download ‘wsl_update_x64’ setup file.

                   

Double click on the setup file you downloaded in the step above and press ‘yes’ when prompted for permission.

                                     

  • Once you’ve enabled and updated the WSL for Windows 10, you can run Docker searching for it in the Start menu.
  • Verify Docker Installation
  • The white whale in the system tray indicates that Docker is running. But you can also test your docker installation by opening the PowerShell or CMD and typing docker –version

PS C:\Users\ATH> docker –versionDocker version 19.03.8, build afacb8b

Next, try to pull the hello-world image and run a container by running docker run hello-world command in PowerShell or CMD:

PS C:\Users\ATH> docker run hello-worldUnable to find image ‘hello-world:latest’ locallylatest: Pulling from library/hello-world0e03bdcc26d7: Pull completeDigest: sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1Status: Downloaded newer image for hello-world:latest Hello from Docker!

This message shows that your installation appears to be working correctly.

This message shows that our Docker installation was successful and we are ready to pull images and create containers.