Albert Callarisa Roca

Tech blog

Disable ssl to boot2docker

27 Nov 2014

I use boot2docker to have docker on OSX. I use it a lot, my side project (dolater.io) is a docker based background jobs runner.
Internally I use the Docker Remote API and, even though is not recommended, I disable the encryption on the TCP socket and I found it a bit hard to find how to disable it.

The reason why I disable TCP is because I have very different environments running docker and all of them are accessible in a secure way, never get orders from the outside on runtime, always from inside. So I want to code the client that work on all systems and I don't want to worry about the SSL since it doesn't make any difference in my case.

The first thing to do is ssh into the virtual machine with boot2docker ssh. Once inside the machine, run sudo vi /var/lib/boot2docker/profile and add the following line:

DOCKER_TLS="no"
And restart the docker host with boot2docker restart.

You can see more environment variables you can tweak reading the docker init.d script on boot2docker

From now on remember that your local docker host is not encrypted, so you'll probably need to change the environment variables accordingly. In my case I have the following:

$ env | grep DOCKER
DOCKER_HOST=tcp://192.168.59.103:2376
DOCKER_TLS_VERIFY=