Open advnpzn opened 6 months ago
cd /tmp/
curl https://get.docker.com | sh
sudo docker run hello-world
linghengqian@DESKTOP-2OCN434:/tmp$ curl https://get.docker.com | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21596 100 21596 0 0 175k 0 --:--:-- --:--:-- --:--:-- 177k
# Executing docker install script, commit: 0d6f72e671ba87f7aa4c6991646a1a5b9f9dae84
WSL DETECTED: We recommend using Docker Desktop for Windows. Please get Docker Desktop from https://www.docker.com/products/docker-desktop/
You may press Ctrl+C now to abort this script.
Server: Docker Engine - Community Engine: Version: 27.2.1 API version: 1.47 (minimum version 1.24) Go version: go1.22.7 Git commit: 8b539b8 Built: Fri Sep 6 12:08:10 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.22 GitCommit: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c runc: Version: 1.1.14 GitCommit: v1.1.14-0-g2c9f560 docker-init: Version: 0.19.0 GitCommit: de40ad0
================================================================================
To run Docker as a non-privileged user, consider setting up the Docker daemon in rootless mode for your user:
dockerd-rootless-setuptool.sh install
Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.
To run the Docker daemon as a fully privileged service, but granting non-root users access, refer to https://docs.docker.com/go/daemon-access/
WARNING: Access to the remote API on a privileged Docker daemon is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' documentation for details: https://docs.docker.com/go/attack-surface/
================================================================================
linghengqian@DESKTOP-2OCN434:/tmp$
sudo apt update && sudo apt upgrade -y
sudo apt-get remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc
cd /tmp/
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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 -y sudo groupadd docker sudo usermod -aG docker $USER newgrp docker
local
of log-driver
sudo vi /etc/docker/daemon.json
sudo systemctl restart docker docker run hello-world
- I would say that Docker Desktop cannot be installed directly under WSL, refer to https://github.com/ubuntu/WSL/issues/486 . Docker Desktop can only be installed in a Windows Native environment.
I observed this git from https://learn.microsoft.com/zh-cn/windows/wsl/tutorials/gpu-compute . But in reality, the script just intentionally does nothing for 20 seconds. The script does not block the installation.
Wow, I guess I shouldn't have just assumed that after the 20 secs delay, it would just exit.
I've tried running the script to install docker in WSL2 (Debian bookworm) and I got the following warning.
But I've modified the script locally to make
is_wsl()
throw a false.And I was able to install docker in my Debian bookworm WSL2. And it is even working perfectly fine.
I want to know why installing Docker in WSL2 is not supported and what issues do we face if someone installs Docker in WSL ?