windows下修改docker镜像、容器存储位置

  • WSL2方式安装的:打开cmd,进行如下步骤
  1. 导出原始文件
wsl --export docker-desktop "E:\Docker\wsl\distro\docker-desktop.tar"
wsl --export docker-desktop-data "E:\Docker\wsl\data\docker-desktop-data.tar"
  1. 注销wsl
wsl --unregister docker-desktop
wsl --unregister docker-desktop-data
  1. 重新导入
wsl --import docker-desktop "E:\Docker\wsl\distro" "E:\Docker\wsl\distro\docker-desktop.tar" --version 2
wsl --import docker-desktop-data "E:\Docker\wsl\data" "E:\Docker\wsl\data\docker-desktop-data.tar" --version 2
  • Hyper-v方式安装的:Settings -> Resources -> Advanced -> Disk image location

你可能感兴趣的:(docker,docker,容器,运维)