本篇文章记录一下在Windows10的Linux上安装Docker
安装Linux
首先在控制面板找到下图:
然后再去Microsoft Store中下载:
配置Docker
安装库
$ sudo apt update
$ sudo apt install ca-certificates curl gnupg lsb-release
在apt上注册Docker的GPG密钥圈
$ sudo mkdir -p /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
把Docker包的源代码添加到系统中
echo “deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
再次更新软件包列表
$ sudo apt update
将Docker的组件添加到你的系统中
$ sudo apt install docker-ce docker-ce-cli containerd.io