windows10中docker迁移目录

比如要把docker转移到d:/docker中

1.暂停docker中的服务

在管理工具中暂停

2.把文件复制到d:/docker中去

c:\Program Files\Docker -> E:\docker\Docker

c:\ProgramData\DockerDesktop -> e:\docker\DockerDesktop

3.创建链接

C:\Users\Administrator>cmd /c mklink /D "c:\Program Files\Docker" e:\docker\Docker
为 c:\Program Files\Docker <<===>> e:\docker\Docker 创建的符号链接

C:\Users\Administrator>cmd /c mklink /D "c:\ProgramData\DockerDesktop" e:\docker\DockerDesktop
为 c:\ProgramData\DockerDesktop <<===>> e:\docker\DockerDesktop 创建的符号链接

如果遇到如下的问题

ERROR: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified.
errors pretty printing info

则执行如下的命令

PS E:\docker\Docker\Docker> .\DockerCli.exe -SwitchDaemon
PS E:\docker\Docker\Docker>

亲测可用

你可能感兴趣的:(docker)