Docker 101: Installation Guide
PART II

Hey there! 👋 I'm Dev Jobalia, a Web Developer from India with a passion for Computer Science. I bring years of experience, a versatile tech toolkit, and a knack for fostering seamless teamwork.
#WebDev #TechEnthusiast #Teamwork
Running Windows and Linux Containers on Windows:
To run a Windows container on a Windows host, you don't need a virtual machine.
Containers are isolated environments where applications run, interacting with the host OS and kernel.
Windows-based containers won't run on Linux-based Docker containers; they require a Windows system to operate.
Running Linux containers on a Windows host, a virtual machine is often used to create an isolated environment where these containers can operate. Two common ways to set up this virtual machine are through:
Docker Desktop: Docker Desktop is a tool for Windows that simplifies the process of running Docker containers, including Linux containers. It manages a virtual machine in the background that handles the Linux-based containers, allowing them to run alongside Windows containers on a Windows host.
PREFERRED Windows Subsystem for Linux (WSL): WSL is a compatibility layer for running Linux binary executables natively on Windows. You can install a Linux distribution on WSL (e.g., Ubuntu), and this Linux environment can be used to run Linux containers, making it possible to work with both Windows and Linux containers on the same Windows machine.
In both cases, a virtual machine is involved in running Linux containers on a Windows host to provide the necessary compatibility and isolation.
INSTALLING DOCKER ON WINDOWS
Requirements:
A 64-bit version of Windows 10 or Windows Server 2016 (or later) is required.
You must have hardware virtualization enabled in your BIOS.
Installation Steps:
Install Windows Subsystem for Linux (WSL):
Open PowerShell as an administrator.
Check if WSL is already installed:
wsl --statusView available Linux distributions that can be downloaded:
wsl --list --online
Install a Linux Distribution:
- You need to install a Linux distribution to run Docker.
wsl --install -d Debian
- Run the following command to enable the WSL feature:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Restart your computer.
Upgrade WSL 2:
Open PowerShell as an administrator.
Check the WSL version:
wsl --statusIf already have version 2 then skip next sub-stepsRun the following command to set WSL from version 1 to 2 as the default version:
wsl --set-default-version 2Reinstall your chosen Linux distribution for version 2:
wsl --set-version Debian 2 wsl --update
Install Docker Desktop:
- Download and install Docker Desktop for Windows from the Docker website: Docker Desktop for Windows
Enable WSL Integration in Docker Desktop:
After installing Docker Desktop, open it.
In the Docker Desktop settings, go to "Resources" and then "WSL Integration."
Enable WSL integration for the Linux distribution you installed (e.g., Ubuntu).
Docker Engine Configuration:
Set
buildkittofalsein Docker Engine configuration.{ "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "experimental": false, "feature": { "buildkit": false } }In your Docker Desktop extension settings, check the box for "Allow only extensions distributed through the Docker Marketplace."
Resource Allocation (Optional):
- In Docker Desktop's "Resources" > "Advanced," you can configure limits on memory, CPU, and swap size allocated to WSL 2 by setting up a
.wslconfigfile.
- In Docker Desktop's "Resources" > "Advanced," you can configure limits on memory, CPU, and swap size allocated to WSL 2 by setting up a
Apply and Restart:
- Click "Apply" in Docker Desktop settings and restart the application.
Test Docker:
- In your Linux distribution terminal (e.g., Ubuntu), run Docker commands to create and manage containers.
With these steps completed, you should have Docker successfully installed and integrated with Windows through WSL. You can now create and manage containers on your Windows machine.
Docker desktop includes:
Docker CLI client
Docker Scout (additional subscription may apply)
REFERENCE


