Docker: Could not read CA certificate: no such file or directory

I’m on OSX and I’ve used docker-machine before, but now that there is a native Docker for Mac I wanted to install that.
So I uninstalled docker-machine using this uninstall script, and then I installed and started Docker for Mac without a problem.

I can run docker --help, which shows me all options as expected.

  • How can delay my node-red docker service with docker compose?
  • Setting the docker server IP as an environment variable using the gradle-docker-plugin
  • Docker-Compose POSTGRES script only creates db not table
  • Docker: Where to store version of multiple images for docker-compose?
  • Docker configuration using the systemd configuration style
  • How to implement microservices [Node.js]?
  • When I run docker ps however, I get the following:

    $ docker ps
    Could not read CA certificate “/Users/kramer65/.docker/machine/machines/default/ca.pem”: open /Users/kramer65/.docker/machine/machines/default/ca.pem: no such file or directory

    I tried the solution from this answer (including sourcing the .bash_profile to activate it), but that didn’t solve anything.

    Does anybody know what I can do to solve this?

  • Xdebug ignores breakpoints in Netbeans for Php project created inside Docker container
  • Broadcasting UDP from within a Docker container
  • How to save config file inside a running container?
  • CircleCI './docker-compose.yml' service 'version' doesn't have any configuration options
  • access data volume of node modules outside docker container
  • How to build docker images with volumes for production
  • One Solution collect form web for “Docker: Could not read CA certificate: no such file or directory”

    Please remove your old docker-machine

    docker-machine rm default

    then, edit your .bashrc .profile or .zshrc ( whatever you use ) and remove anything that exports DOCKER env variables ( like socket, host, port and so on ).

    Restart your shell at least, you can restart your mac. When you do


    env | grep DOCKER

    You should see nothing. docker ps should now work flawlessly.

    Background:
    The problem is that the old dockertoolbox defines a custom host / port and puts that into your bashrc and does not remove it after deinstallation.

    docker for mac uses the unix default socket, but it will not get picked up until you remove those old ENV variales

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.