[Docker for Windows] Certificate Error Solution

Problem Definition: After installing “Docker for Windows” on Windows 10 Professional box, when you type any docker command or lets say for eg. docker ps, you get following error:

 

could not read CA certificate "C:\\Users\\UserName\\.docker\\machine\\machines\\default\\ca.pem": open C:\\Users\\UserName\\.docker\machine\machines\default\ca.pem: The system cannot find the path specified.

 

Solution: you need to delete all DOCKER_* environment variables from your machine. Which needs to be done in 2 steps:

Step 1> Go to Control Panel\All Control Panel Items\System Then click Advanced system settings, In System Propteries, Go to Advanced Tab and Click Environment Variables. Delete all DOCKER_* from System/User variables.

Step 2> Remove DOCKER_* from command prompt or PowerShell, i used PowerShell. using following steps:

[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")

Now Close and Open Powershell again and now run docker ps it will work fine without any Certificate Error.

Fonte: https://apilevel.wordpress.com/2017/11/23/docker-for-windows-certificate-error-solution/

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *