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.
And in the log.txt located in “C:\Users\UserName\AppData\Local\Docker\log.txt” you get a warning like following:
[11:14:53.591][DockerClientEnvironmentChecker][Warning] DOCKER_HOST environment variable detected, docker may not work properly [11:14:53.591][DockerClientEnvironmentChecker][Warning] DOCKER_TLS_VERIFY environment variable detected, docker may not work properly
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.
When trying to Remove DOCKER_* from command prompt or PowerShell,, Getting error “bash: syntax error near unexpected token `”DOCKER_CERT_PATH”,'”
Can anyone suggest how to resolve that
thanks bro, you save my live. nice tutorial