boot2docker / osx-installer

Docker installer for Mac OS X
Apache License 2.0
1.25k stars 258 forks source link

ca.pem: no such file or directory #126

Closed IdanAdar closed 8 years ago

IdanAdar commented 8 years ago

So... I wanted to start afresh. For this, I used the boot2docker "uninstaller": https://github.com/boot2docker/osx-installer/blob/master/uninstall.sh

I then installed Docker Toolbox, but I'm getting the following:

docker is configured to use the default machine with IP 192.168.99.100 For help getting started, check out the docs at https://docs.docker.com

open /Users/idanadar/.docker/machine/machines/default/ca.pem: no such file or directory bash-3.2$ docker run hello-world Could not read CA certificate "/Users/idanadar/.boot2docker/certs/boot2docker-vm/ca.pem": open /Users/idanadar/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory bash-3.2$

How do I fix this?

IdanAdar commented 8 years ago

The issue was with my .bash_profile. It should be like this:

DOCKER

export DOCKER_HOST=tcp://192.168.99.100:2376 export DOCKER_MACHINE_NAME=default export DOCKER_TLS_VERIFY=1 export DOCKER_CERT_PATH=/Users/idanadar/.docker/machine/machines/default

ceecer1 commented 8 years ago

Thanks for figuring out and it works. I was having the exact case.

denisinla commented 8 years ago

+1 this definitely worked out for me as well.

gempesaw commented 8 years ago
$ docker-machine env default
open /Users/dgempesaw/.docker/machine/machines/default/ca.pem: no such file or directory

I was also migrating from boot2docker to docker-machine. After clearing out boot2docker's settings from my ~/.bash_profile as suggested, docker-machine env was having trouble finding that ca.pem, which is oddly in the OP's error as well. The missing ca.pem file was fixed by doing

$ docker-machine regenerate-certs default

:D

marhan commented 8 years ago

Thanks, it worked for me.

elgreg commented 8 years ago

:+1: saved me a huge headache. This should definitely be added to the FAQ on https://www.docker.com/toolbox

rockper commented 8 years ago

gempesaw's solution (regenerate-certs) worked for me too.

abbinv commented 8 years ago

gempesaw's solution (regenerate-certs) worked for me too. :D :dancer:

jonmach commented 8 years ago

Thanks @IdanAdar sorted it perfectly. This was driving me mad.

treeder commented 8 years ago

+1. thanks!

patrickaroo commented 8 years ago

fixity fixed. Thanks!

changgull commented 8 years ago

@IdanAdar thank you. You're solution still works and I agree with @elgreg that this should be a part of the starter document from docker for the migrators from boot2dock.

jakerobers commented 8 years ago

@gempesaw thank you. This solution worked.

bmfallon commented 8 years ago

I seem to be having this issue with Docker Toolbox. When running:

docker-machine regenerate-certs default

I get the following: Regenerating TLS certificates Host does not exist: "default"

It appears as though the quick start terminal doesn't create a machines directory with the default machine in it. Anyone else have this issue?

bmfallon commented 8 years ago

It appears as though running Kitematic generated the default VM and fixed this issue for me. Still think it should be considered a bug as the Quickstart Terminal should have created it.

banacorn commented 8 years ago

@bmfallon +1

The Quickstart Terminal doesn't work, but running Kitematic fixed it somehow.

jasonwbarnett commented 8 years ago

For others... I had old environment variables in both my zsh and bash rc files which conflicted with the newer Docker Quickstart Terminal. After I removed the older zsh and bash rc crap I manually configured a while ago it worked.

ryanbnl commented 8 years ago

I have the same issue on using the very latest docker for windows:

Could not read CA certificate "C:\\Users\\ryan\\.docker\\machine\\machines\\default\\ca.pem": open C:\Users\ryan\.docker\machine\machines\default\ca.pem: The system cannot find the file specified.

Copying the certificates from:

C:\Users\ryan\.docker\machine\certs

..into that directory fix the problem; although it would be nice if it just worked.

Use-case: I'm just working through the docker hello-world use-case on my new Windows 10 machine.

liqiang-ICT commented 8 years ago

Thanks a lot!

banacorn commented 8 years ago

By the way, just curious, will all of these problems go away when Docker goes native on OS X?

changjunjie commented 8 years ago

Thanks@IdanAdar, it works for me.

reubano commented 8 years ago

cp -f ~/.docker/machine/certs/* ~/.docker/machine/machines/dev/ worked for me

konglee28 commented 7 years ago

Usually most people have install boot2docker and old version of virtualbox. As said in installation guide, before installing Docker for Mac, we have to uninstall boot2docker and reinstall virtualbox to high version. https://docs.docker.com/engine/installation/mac/#/docker-for-mac

Even though we have installed Docker for Mac, we still encountered error "Could not read CA certificate".

My solution is to remove the docker related environment variables (DOCKER_) from .bash_profile.

  1. vim ~/.bash_profile
  2. Comment something like *DOCKER***
  3. source ~/.bash_profile
  4. relaunch the terminal, you should have no problem on running : docker info or docker ps

Hope it helps.