安装 docker,wsl 必须是2
-
使用sh脚本
docker_instal.shcurl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker xx
sh docker_install.sh
查看是否安装成功
docker version如果出现 ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info”: dial unix /var/run/docker.sock: connect: permission denied
则使用 sudo docker version -
命令
#配置阿里云的gpg
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
#配置阿里云的docker镜像
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"<br>
#执行安装命令
sudo apt-get install docker-ce docker-ce-cli containerd.io