Reputation: 6680
We want to set up a Docker development node where anybody in our team can deploy things to.
I created a new Docker machine using SSH, like this:
docker-machine create \
--driver generic \
--generic-ip-address=xxx.xxx.xxx.xxx \
--generic-ssh-user=myuser \
mymachine
Using docker-machine env mymachine
, I set up my environment. But what steps does another developer need to perform to have access to the same machine?
Unfortunately, there is not anything like docker-machine add ...
(https://github.com/docker/machine/issues/3212)
What's the easiest and the current Docker'ic way of achieving it?
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://xxx.xxx.xxx.xxx:2376"
export DOCKER_CERT_PATH="/Users/user/.docker/machine/machines/mymachine"
export DOCKER_MACHINE_NAME="mymachine"
But what about with the certs? Copy the same certs over or generate new ones for him?
Upvotes: 3
Views: 275
Reputation: 452
In my experience, development docker workflows are much more pleasant when run locally. You can mount your file system for quick iteration. And when building images, the time to copy context is much reduced. Plus when installing the docker command-line, your team may install docker engine as well.
But I get that you might want to prove out docker without asking folks to maintain a VM or install locally - so on to actual answers:
What steps does another developer need to perform to have access to the same machine?
The environment variables from docker-machine env
(and the files referenced there) would be enough. Though that still leaves you the issue of copying the certificates around - as discussed in your github link.
Copy the same certs over or generate new ones?
(Based on the tls configuration) I believe a docker daemon can only support one set of certs.
What's the easiest and the current Docker'ic way of achieving [a shared machine]?
The certificate is there for your security, but it can be disabled. If you're confident in your local network security, and using the service for development - you can have the host expose an http port.
That can be done via docker-machine at create time: (example from this question: boot2docker without tls verification)
docker-machine create -d virtualbox --engine-env DOCKER_TLS=no --engine-opt host=tcp://0.0.0.0:2375 node1
Once the service is exposed on a tcp port with TLS disabled, anyone can access it from the docker command line with the -H
flag.
docker -H xxx.xxx.xxx.xxx:2375 images
Setting the DOCKER_HOST environment variable will save some typing.
Upvotes: 1