Based on my experience with Docker CLI installation on Windows and issues faced, I thought of writing this step-by-step blog for installation of Docker and Kubernetes on Windows machine. This is 2 part series - Part 1 and Part 2.
While the docker instructions are great and most of this is following the same however, there were some hiccups which I encountered during installation. The issues I faced and solutions (after lot of googling) I’ll cover in this series – the primary intent of it in case you find yourself stuck with same issue.
Note – For enterprise applications, I’d recommend Docker Desktop as I found it much more robust, stable, and easy to use provided you are using it under the licensing restrictions.
Docker CLI is free and works best for small hands-on applications which you might want to try things out.
Alright, so let’s get right into it ….
Step 1: Make sure Virtualization is enabled on your Windows machine. Refer below screenshot of Task Manager. If you don’t see this, follow these instructions.
Step 2: Make sure Windows Subsystem for Linux (WSL) is enabled from “Turn Windows Features On or Off” in your system.
Step 3: Go the Microsoft Store on your machine and search for “Ubuntu 20.04 LTS”. Install this.
After installation, open Poweshell and enter below command
wsl.exe -l -v
If you see version 1 of Ubuntu, we need to convert/upgrade this to version 2. If you see 2, jump to Step 4.
Run below command to convert/upgrade to version 2,
wsl.exe --set-version Ubuntu 2
Step 4: Open the Ubuntu App. This will open the Linux shell.
Step 5: If you have older versions of Docker installed, uninstall them (run this anyways if you are not sure)
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
Step 6: Run below commands in order they are mentioned:
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg| sudo gpg --dearmor -o \ /etc/apt/keyrings/docker.gpg
echo "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) 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-compose-plugin
Step 7: Docker should now be successfully installed on your system. To test this, run below command
sudo docker run hello-world
References:
コメント