WSL安装
安装
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
# 信任 Docker 的 GPG 公钥:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 安装docker
sudo apt-get update
sudo apt-get install docker-ce
启动Docker
Linux中是使用systemctl start docker
而这里是使用sudo service docker start
报错及问题解决
E: Package ‘docker-ce’ has no installation candidate
解决办法:
sudo echo "deb https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list.d/docker.list
sudo apt update && sudo apt install docker-ce
Error response from daemon: Get https://index.docker.io/v1/search?q=mysql&n=25: dial tcp: lookup ind
解决办法:
cd /etc/docker
vim daemon.json
- 在文件中加入:
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}