Skip to content

Docker on WSL2

phaledang edited this page May 31, 2024 · 14 revisions

This step is done on the WSL2 Ubuntu. Open the ubuntu from start menu or use Powershell, run wsl to run the ubuntu

copy the content from https://github.com/phaledang/ai-python/blob/main/docker%20install.txt to run

Steps includes:

sudo apt-get update

If there is network issue with "sudo apt-get update"

run "sudo nano /etc/resolv.conf" to add 2 below lines in the file, ctrl X to save naneserver 8.8.8.8 naneserver 1.1.1.1

sudo apt-get install
apt-transport-https
ca-certificates
curl
gnupg
lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] 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

sudo service docker start

sudo groupadd docker

sudo usermod -aG docker $USER

newgrp docker `

Check docker version:

docker -v

References

Clone this wiki locally