Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Cert issue migrating from boot2docker to this box #19

Closed
phpguru opened this issue May 15, 2015 · 1 comment
Closed

Cert issue migrating from boot2docker to this box #19

phpguru opened this issue May 15, 2015 · 1 comment

Comments

@phpguru
Copy link

phpguru commented May 15, 2015

In trying to migrate from a bit outdated, but working boot2docker setup to the latest and greatest NFS solution you posted recently. Super jacked about the possibility of speeding up things with NFS. Anyway, I am just doing something wrong and hoping you can help.

After upgrading Vagrant, Boot2Docker, Docker and trying your vagrantfile.tpl edits wth vagrant init I'm getting an error connecting to the docker daemon.

docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): darwin/amd64
FATA[0000] An error occurred trying to connect: Get https://192.168.10.10:2376/v1.18/version: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.10.10 

I saw you have the ssh key regeneration disabled so I am guessing I need to regenerate keys? I am currently using the following in ~/.bash_profile

export B2D_NFS_SYNC=1
export DOCKER_HOST=tcp://192.168.10.10:2376
export DOCKER_CERT_PATH=/Users/myusername/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1

When I try changing the IP to localhost:2376 I get

FATA[0000] An error occurred trying to connect: Get https://localhost:2376/v1.18/version: x509: certificate is valid for boot2docker, not localhost 

I tried fiddling with the cert path, and running $(boot2docker shellinit) but it didn't help.

The box is running fine, NFS mount works, and I can vagrant ssh and run docker ps -a no problem, so I'm 99% there, its just tricking Mac Yosemite Terminal into connecting right. Thanks for any advice!

@phpguru
Copy link
Author

phpguru commented May 15, 2015

Answering my own question...

Run this (from the README.md)

# Regenerate certs for the newly created Iprivate network IP
sudo /etc/init.d/docker restart
# Copy tls certs to the vagrant share to allow host to use it
sudo cp -r /var/lib/boot2docker/tls /vagrant/

Edit ~/.bash_profile as:

export B2D_NFS_SYNC=1
export DOCKER_HOST=tcp://127.0.0.1:2376
export DOCKER_CERT_PATH=<ABSOLUTE_PATH_TO_SHARED>/tls
export DOCKER_TLS_VERIFY=1

In other words, I didn't realize this part of the docs applied to my situation. Thanks @dduportal!

@phpguru phpguru closed this as completed May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant