Steps to setup docker on Windows 10/11 system without installing Docker Desktop application, which is just a GUI for docker.
First, you need to install WSL (Windows subsystem for Linux) if not already installed -
wsl --install
Note: It will install ubuntu linux as default linux flavour. If you need to check and install any other use below command:
wsl --list --online
wsl --install kali-linux
Next, install docker using below commands
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Last, verify docker is installed and running successfully.
docker run hello-world
docker run docker/getting-started
Verify all processes running on ubuntu machine.
Finally, to view and setup getting-started with docker code, download and install git using :
sudo apt-get install git
Ref - https://medium.com/geekculture/run-docker-in-windows-10-11-wsl-without-docker-desktop-a2a7eb90556d
Ref - https://docs.docker.com/engine/install/ubuntu/#installation-methods