Docker Hub Container Image Library | App Containerization
Windows 使用 Docker 之前需要先准备好 WSL。具体怎么准备,参考:WSL。
完成之后做两件事情:
修改配置文件
{
"registry-mirrors": [
"<https://docker.mirrors.ustc.edu.cn/>"
],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
},
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
}
}
修改数据存储位置
# first quit docker desktop
wsl --list -v
wsl --shutdown
wsl --list -v
wsl --export docker-desktop-data "D:\\Root\\Apps\\Docker\\Data\\wsl\\data\\docker-desktop-data.tar"
wsl --unregister docker-desktop-data
wsl --import docker-desktop-data "D:\\Root\\Apps\\Docker\\Data\\wsl\\data" "D:\\Root\\Apps\\Docker\\Data\\wsl\\data\\docker-desktop-data.tar" --version 2
rm "D:\\Root\\Apps\\Docker\\Data\\wsl\\data\\docker-desktop-data.tar"
# Windows 中 Docker 相关目录
C:\\ProgramData\\Docker
C:\\ProgramData\\DockerDesktop
C:\\Users\\%USERPROFILE%\\AppData\\Local\\Docker
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
How To Install and Use Docker on Ubuntu 22.04 | DigitalOcean