31

I installed Docker on Windows 10 Pro and I can't get it to work.

When I try to run hello-world I get

could not read CA certificate 

It's looking for the certificates in the machine/machines/default . However that folder didn't exist.

I created a machine called "default" (which created the above mentioned folder) but that didn't help.

Before that I created another machine called "dev" which seems to have certificates, but that doesn't seem to be helping either.

Also there are certificate files in machine/machines - I don't know if I should somehow point Docker to look in that folder (instead of machine/machines/default) ?

I'm pretty new to Docker so I might be missing something. However I've been at this all day, read the Docker documentation, tried plenty of solutions and similar answers but nothing seems to be working.

8 Answers 8

89

I had the same issue. The problem was, that I upgraded from Docker Toolbox to Docker for Windows. When you uninstall Docker Toolbox, the user-specific env variables get not removed. The following did the trick for me:

  1. Uninstall Docker Toolbox.
  2. Uninstall VirtualBox (You cannot use VirtualBox, as it is necessary for Docker Toolbox and Hyper-V [used by Docker for Windows] at the same time.)
  3. Remove the Docker Toolbox env variables:
    • Go to Control Panel\All Control Panel Items\System.
    • Click Advanced system settings
    • Go to Advanced Tab and click Environment Variables.
    • Delete all DOCKER_* entries from System/User variables.
      • DOCKER_TLS_VERIFY
      • DOCKER_CERT_PATH
      • DOCKER_HOST
      • DOCKER_TOOLBOX_INSTALL_PATH
  4. Remove DOCKER_* from command-prompt or PowerShell. Run these command in PowerShell:

    [Environment]::SetEnvironmentVariable("DOCKER_CERT_PATH", $null, "User")

    [Environment]::SetEnvironmentVariable("DOCKER_HOST", $null, "User")

    [Environment]::SetEnvironmentVariable("DOCKER_MACHINE_NAME", $null, "User")

    [Environment]::SetEnvironmentVariable("DOCKER_TLS_VERIFY", $null, "User")

    [Environment]::SetEnvironmentVariable("DOCKER_TOOLBOX_INSTALL_PATH", $null, "User")

  5. Restart PowerShell. (If necessary, restart system as well.)

Sources:

8
  • Yes! For those of us migrating this is what you need to do.
    – Dave Brock
    May 12, 2018 at 15:10
  • Is it really necessary to uninstall virtual box? Cant you just not run it ?
    – Jepzen
    Sep 12, 2018 at 7:12
  • Worked after the clean up as mentioned above. Didn't have to restart. Sep 21, 2018 at 1:01
  • It works on Winows 8.1 too. I didn't have to restart.
    – GabrielBB
    Nov 8, 2018 at 19:12
  • why to make it easy if it can be a pain? (my life as developer using Windows)
    – chachan
    Mar 11, 2019 at 18:04
8

Environment variables hanging around from previously (long) removed Docker Toolbox installation caused this problem with Docker Desktop (which was started ok after HyperV. Removed them all, remove these environmental variables

  • DOCKER_TLS_VERIFY
  • DOCKER_CERT_PATH
  • DOCKER_HOST
  • DOCKER_TOOLBOX_INSTALL_PATH

, restart terminal, all working great now

4

Sometimes it's not that much tricky. I have just resolved this problem by doing this:

Go to THIS PC:-> in search bar type ca.pem -> and now go to that location and copy it -> now go to Advanced System Settings -> Environment Variables -> Edit - DOCKER_CERT_PATH -> and PASTE that location and by doing this it will run

1
  • 1
    I try that and I pass the certificate difficulty but after I had problem with tcp-ip address : I finally delete all environment variable that start by DOCKER_... or COMPOSE_... because I used Docker toolbox (Windows 10 familial) before uninstall and finally install docker on Windows 10 professional. The solution is describe below. Jul 1, 2019 at 15:26
1

Hey I have got similar problems, I started with this kind of error

'http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/containers/create: open //./pipe/docker_engine'

After that I also had problems with certificates. What I did was to change the location of my cert files into another location and point to it by environment variable DOCKER_CERT_PATH. Then I went through all different issues which at the end solved my problem only partially. Finally, I uninstalled my docker toolbox and VM Virtualbox and reinstalled it again with different, older driver NDIS5 which you can choose in wizard during installation. It solved all my problems with Docker on win10

Wizard during installation Docker toolbox

1

Deleting the environment variables and running the commands mentioned above worked for me:

[Environment]::SetEnvironmentVariable("DOCKER_CERT_PATH", $null, "User")

[Environment]::SetEnvironmentVariable("DOCKER_HOST", $null, "User")

[Environment]::SetEnvironmentVariable("DOCKER_MACHINE_NAME", $null, "User")

[Environment]::SetEnvironmentVariable("DOCKER_TLS_VERIFY", $null, "User")

[Environment]::SetEnvironmentVariable("DOCKER_TOOLBOX_INSTALL_PATH", $null, "User")
0
0

I also had the same problem. I have changed my DOCKER_CERT_PATH value to C:\Users\adity.docker\machine\certs. It worked fine.

0

For those running docker machine on Oracle VM Virtualbox, you simply need to delete the corrupted machine and recreate.

Since there is no recreate command you either remove the corrupted machine using this command:


docker-machine rm docker-machine-name-here

e.g. docker-machine rm boot2docker


or remove the machine manually. To remove manually, go to "C:\Users\'user'\.docker\machine\machines" and you will find the directory list of machines, and remove the corrupted machine's directory.

To create a new machine, use this command:

docker-machine create -d virtualbox --virtualbox-memory 4096 your-machine-name-here

e.g. docker-machine create -d virtualbox --virtualbox-memory 4096 boot2docker

Verify if creation was successful, status and configuration details using this command:

docker-machine env your-machine-name-here

e.g. docker-machine env boot2docker

You might try another shortcut to avoid losing your existing containers and docker images; recreate the certificates using this command:

docker-machine regenerate-certs your-machine-name-here

e.g. docker-machine regenerate-certs boot2docker

-1

Run Docker Desktop as Admin Rights. It Worked with me. I am not able to see this error " 'appdata\local\docker\vm-config\ca-certificates.crt' is denied" Now, I can run Linux containers on Windows 10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.