Docker: could not read CA certificate Docker: could not read CA certificate docker docker

Docker: could not read CA certificate


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:


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


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