This repository has been archived by the owner. It is now read-only.

ca.pem: no such file or directory #126

Closed
IdanAdar opened this Issue Aug 13, 2015 · 23 comments

Comments

Projects
None yet
@IdanAdar

IdanAdar commented Aug 13, 2015

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

This comment has been minimized.

Show comment
Hide comment
@IdanAdar

IdanAdar Aug 16, 2015

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

IdanAdar commented Aug 16, 2015

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

@IdanAdar IdanAdar closed this Aug 16, 2015

@ceecer1

This comment has been minimized.

Show comment
Hide comment
@ceecer1

ceecer1 Aug 26, 2015

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

ceecer1 commented Aug 26, 2015

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

@denisinla

This comment has been minimized.

Show comment
Hide comment
@denisinla

denisinla Sep 14, 2015

+1 this definitely worked out for me as well.

denisinla commented Sep 14, 2015

+1 this definitely worked out for me as well.

@gempesaw

This comment has been minimized.

Show comment
Hide comment
@gempesaw

gempesaw Sep 21, 2015

$ 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

gempesaw commented Sep 21, 2015

$ 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

This comment has been minimized.

Show comment
Hide comment
@marhan

marhan Oct 13, 2015

Thanks, it worked for me.

marhan commented Oct 13, 2015

Thanks, it worked for me.

@elgreg

This comment has been minimized.

Show comment
Hide comment
@elgreg

elgreg Oct 17, 2015

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

elgreg commented Oct 17, 2015

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

@rockper

This comment has been minimized.

Show comment
Hide comment
@rockper

rockper Nov 3, 2015

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

rockper commented Nov 3, 2015

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

@abbinv

This comment has been minimized.

Show comment
Hide comment
@abbinv

abbinv Nov 3, 2015

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

abbinv commented Nov 3, 2015

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

@jonmach

This comment has been minimized.

Show comment
Hide comment
@jonmach

jonmach Nov 7, 2015

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

jonmach commented Nov 7, 2015

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

@treeder

This comment has been minimized.

Show comment
Hide comment
@treeder

treeder Nov 10, 2015

+1. thanks!

treeder commented Nov 10, 2015

+1. thanks!

@patrickaroo

This comment has been minimized.

Show comment
Hide comment
@patrickaroo

patrickaroo Nov 19, 2015

fixity fixed. Thanks!

patrickaroo commented Nov 19, 2015

fixity fixed. Thanks!

@changgull

This comment has been minimized.

Show comment
Hide comment
@changgull

changgull Nov 24, 2015

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

changgull commented Nov 24, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@jakerobers

jakerobers Nov 30, 2015

@gempesaw thank you. This solution worked.

jakerobers commented Nov 30, 2015

@gempesaw thank you. This solution worked.

@bmfallon

This comment has been minimized.

Show comment
Hide comment
@bmfallon

bmfallon Dec 9, 2015

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 Dec 9, 2015

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

This comment has been minimized.

Show comment
Hide comment
@bmfallon

bmfallon Dec 9, 2015

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.

bmfallon commented Dec 9, 2015

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

This comment has been minimized.

Show comment
Hide comment
@banacorn

banacorn Dec 22, 2015

@bmfallon +1

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

banacorn commented Dec 22, 2015

@bmfallon +1

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

@jasonwbarnett

This comment has been minimized.

Show comment
Hide comment
@jasonwbarnett

jasonwbarnett Feb 1, 2016

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.

jasonwbarnett commented Feb 1, 2016

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

This comment has been minimized.

Show comment
Hide comment
@ryanbnl

ryanbnl Feb 20, 2016

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.

ryanbnl commented Feb 20, 2016

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

This comment has been minimized.

Show comment
Hide comment
@liqiang-ICT

liqiang-ICT Apr 17, 2016

Thanks a lot!

liqiang-ICT commented Apr 17, 2016

Thanks a lot!

@banacorn

This comment has been minimized.

Show comment
Hide comment
@banacorn

banacorn Apr 17, 2016

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

banacorn commented Apr 17, 2016

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

@changjunjie

This comment has been minimized.

Show comment
Hide comment
@changjunjie

changjunjie May 19, 2016

Thanks@IdanAdar, it works for me.

changjunjie commented May 19, 2016

Thanks@IdanAdar, it works for me.

@reubano

This comment has been minimized.

Show comment
Hide comment
@reubano

reubano Jun 14, 2016

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

reubano commented Jun 14, 2016

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

@konglee28

This comment has been minimized.

Show comment
Hide comment
@konglee28

konglee28 Sep 5, 2016

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.

konglee28 commented Sep 5, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.