简体   繁体   English

在 Windows 上更改 docker 位置后出现证书错误

[英]Certificate errors after changing docker location on windows

I've moved my docker location from my C:\\ drive to another drive.我已将我的 docker 位置从我的 C:\\ 驱动器移动到另一个驱动器。 I did this initially by removing the docker machine (docker-machine rm) and creating a new one ($ docker-machine --storage-path "D:\\users\\me\\.docker\\machine" create --driver virtualbox default).我最初通过删除 docker 机器(docker-machine rm)并创建一个新机器($ docker-machine --storage-path "D:\\users\\me\\.docker\\machine" create --driver virtualbox default)来做到这一点.

I also set the environment variable MACHINE_STORAGE_PATH="D:\\users\\me\\.docker\\machine" which was needed to get docker to see the newly created machine.我还设置了环境变量 MACHINE_STORAGE_PATH="D:\\users\\me\\.docker\\machine",这是让 docker 查看新创建的机器所需的。

Now when I run, for example, docker images, I get the following error:现在,例如,当我运行 docker 图像时,出现以下错误:

Could not read CA certificate "C:\\Users\\me\\.docker\\machine\\machines\\default\\ca.pem": open C:\\Users\\me.docker\\machine\\machines\\default\\ca.pem: The system cannot find the path specified.无法读取 CA 证书“C:\\Users\\me\\.docker\\machine\\machines\\default\\ca.pem”:打开 C:\\Users\\me.docker\\machine\\machines\\default\\ca.pem:系统不能找到指定的路径。

As you can see docker is looking in the old location for the pem file.如您所见,docker 正在寻找 pem 文件的旧位置。

I'm on windows 7 VirtualBox Version 5.0.14 r105127 Docker version 1.10.1, build 9e83765我在 Windows 7 VirtualBox 版本 5.0.14 r105127 Docker 版本 1.10.1,构建 9e83765

Setting DOCKER_CERT_PATH to the location of ca.pem fixed it for me:将 DOCKER_CERT_PATH 设置为 ca.pem 的位置为我修复了它:

export DOCKER_CERT_PATH=D:\\\\users\\\\me\\\\.docker\\\\machine\\\\machines\\\\default export DOCKER_CERT_PATH=D:\\\\users\\\\me\\\\.docker\\\\machine\\\\machines\\\\default

(This is from the docker bash shell) (这是来自 docker bash shell)

Copy certificates from "..\\.docker\\machine\\certs"从“..\\.docker\\machine\\certs”复制证书

Paste certificates to "..\\.docker\\machine\\machines\\default"将证书粘贴到“..\\.docker\\machine\\machines\\default”

If you have created new machine lets say "dev" then copy to "..\\.docker\\machine\\machines\\dev"如果您创建了新机器,请说“dev”然后复制到“..\\.docker\\machine\\machines\\dev”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM