Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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?

like image 663
kramer65 Avatar asked Sep 17 '25 09:09

kramer65


1 Answers

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 uninstallation.

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

like image 180
Eugen Mayer Avatar answered Sep 19 '25 06:09

Eugen Mayer