简体   繁体   中英

Certificate errors after changing docker location on windows

I've moved my docker location from my C:\\ drive to another drive. 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).

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.

Now when I run, for example, docker images, I get the following error:

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.

As you can see docker is looking in the old location for the pem file.

I'm on windows 7 VirtualBox Version 5.0.14 r105127 Docker version 1.10.1, build 9e83765

Setting DOCKER_CERT_PATH to the location of ca.pem fixed it for me:

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

(This is from the docker bash shell)

Copy certificates from "..\\.docker\\machine\\certs"

Paste certificates to "..\\.docker\\machine\\machines\\default"

If you have created new machine lets say "dev" then copy to "..\\.docker\\machine\\machines\\dev"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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