Guideline 001: Install Docker CLI on WSL2

Table of contents

For large companies seeking an alternative to Docker Desktop, which is not free for businesses with more than 200 employees, Docker CLI can be installed on Windows through the use of Microsoft's WSL2 (Windows Subsystem for Linux version 2). This provides a robust solution for running Docker containers on Windows machines, leveraging the full system call compatibility of a Linux kernel. WSL2 thus serves as a powerful tool for businesses to maintain their container-based workflows without incurring additional costs.

Install Docker CLI

  • Step 1: Update the apt package index and install packages to allow apt to use a repository over HTTPS.
sudo apt-get update &&
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common \
    libssl-dev \
    libffi-dev \
    git \
    wget \
    nano
  • Step 2: Add group Docker.
sudo groupadd docker &&
sudo usermod -aG docker $USER
  • Step 3: Install Docker CLI.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable" &&
sudo apt-get update &&
sudo apt-get upgrade -y &&
sudo apt-get autoremove -y &&
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
  • Step 4: Setup auto start Docker (Optional).
echo "sudo service docker start" >> ~/.profile
  • Step 5: Install Docker Compose (Optional).
sudo apt-get install -y docker-compose