2

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

andrea
  • 421
  • 1
  • 7
  • 26
  • Would a `docker-machine regenerate-certs ` help? Or would it still try and recreate new certif in the old place? – VonC Feb 24 '16 at 10:14
  • 1
    Have you tried a `docker-machine env ` or explicitly setting the `DOCKER_CERT_PATH` environment variable? – Frank Schmitt Feb 24 '16 at 10:15
  • regenerate-certs didn't help, I tried setting the path and it doesn't help even though I'm certain I've typed it in correctly and now looks like it's looking in the right place (still doesn't find it), docker-machine env didn't fix it either (and the ca.pem file is there I can see it!) – andrea Feb 24 '16 at 10:31
  • 1
    Got it! setting DOCKER_CERT_PATH works, just need the right format: export DOCKER_CERT_PATH=D:\\users\\me\\.docker\\machine\\machines\\default – andrea Feb 24 '16 at 11:00
  • I have possible answer [here](https://stackoverflow.com/a/57702861/5088735). Feel free to try if it works. – sssanjaya Aug 29 '19 at 04:13

2 Answers2

2

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)

andrea
  • 421
  • 1
  • 7
  • 26
1

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"

Riddhi Gohil
  • 1,602
  • 15
  • 16