Docker-machine : ca.pem not found
Asked Answered
T

5

6

Here i am creating a test machine(dev) using the docker machine.

$ docker-machine create -d virtualbox dev
Creating CA: C:\Users\xxx\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\xxx\.docker\machine\certs\cert.pem
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...

The vm gets created and runs with out flaws. And here is the error when i run the following command:

$ docker-machine env dev

open C:\Users\xxx\.docker\machine\machines\dev\ca.pem: The system cannot fin
d the file specified.

I have no idea how to deal with this problem. Tried restarting boot2docker.

Tharpe answered 22/7, 2015 at 11:27 Comment(0)
A
5

You should try using docker-machine regenerate-certs dev. The problem i think is that somehow your .pem file got deleted or was not created. I had the same issue and regenerating the certs fixed the problem (reboot did not help btw).

Aubyn answered 28/8, 2015 at 15:31 Comment(1)
worked for me, yeah looks like on creating VM docker-machine is adding all certificates in .docker\machine\certs\ folder only, but expecting at .docker\machine\machines\<dev>\ running this command added certs to <dev> as well.Pulpit
G
5

I guess you are getting Docker-machine : ca.pem not found error even when you use docker info or any command with docker

Try this command: docker-machine env -u output will be similar to:

unset DOCKER_TLS_VERIFY

unset DOCKER_HOST

unset DOCKER_CERT_PATH

unset DOCKER_MACHINE_NAME

# Run this command to configure your shell:

# eval $(docker-machine env -u)

now enter eval $(docker-machine env -u)

this should do the work. Try docker info to be sure finally.

Gurgitation answered 29/8, 2019 at 4:10 Comment(0)
S
3

I was getting the exact same error. It turned out to be the Cisco AnyConnect client affecting my networking settings. It's not enough to quit AnyConnect, you have to reboot your machine to restore your settings.

If someone knows more about how AnyConnect is affecting things and if there are solutions better than rebooting, I'd love to hear about it!

Sphenoid answered 23/7, 2015 at 15:22 Comment(2)
Hi david, I am not using AnyConnect.Tharpe
Having AnyConnect definitely seems to be causing issues. The original setup instructions won't work correctly when calling docker-machine env default, but if I reboot and then make the command docker-machine create -d virtualbox dev, a subsequent docker run hello-world works correctly. To make sure, I started AnyConnect again, and tried to make a qa machine with the same commands, which failed with the same errorCatholicism
S
1

Copy certificates from "C:\Users\xxx\.docker\machine\certs"

Paste certificates to "C:\Users\xxx\.docker\machine\machines\dev"

Saccharide answered 31/3, 2016 at 8:42 Comment(0)
N
1

NOTE: This error was on Windows 10 Docker

Here was my error:

@user ➜  git-repo git(users/user/dev) ✗  docker
unable to resolve docker endpoint: open C:\Users\user\.docker\ca.pem: The system cannot find the file specified.

Here is the link to the shell file I used to recreate the certificates I named it generate_docker_cert.sh:

https://gist.github.com/bradrydzewski/a6090115b3fecfc25280

So I went to that directory that the error output:

cd C:\Users\user\.docker\

Created that file:

notepad generate_docker_cert.sh

Copied the values from the link into there and saved.

Then ran that .sh file:

.\generate_docker_cert.sh

Then the docker command worked:

@user ➜  git-repo git(users/user/dev) ✗  docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers
...
Neaten answered 16/9, 2020 at 21:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.