Machine: Docker-machine add existing host

Created on 31 Mar 2017  路  8Comments  路  Source: docker/machine

We need a way to add a machine running the Docker daemon to the docker-machine machine's list. At present it is very difficult/impossible to do this. This means that on older Mac's like mine that don't support the new Docker binary can't use docker unless you provision a new instance. It also means that deploying containers on instances that aren't running x86_64 kernels, such as Raspberry Pi, a huge pain.

I know that this has been covered before, however it this functionality is sorely needed and is heavily requested by the community.

Most helpful comment

No. docker-machine create --driver generic does several things, including changing the hostname to be that of the name given as argument $1. This, as well as restarting/upgrading/downgrading the daemon is less than desirable behavior on a host that has already been provisioned and has containers running on it.

All 8 comments

--driver generic isn't fit for your use case?

No. docker-machine create --driver generic does several things, including changing the hostname to be that of the name given as argument $1. This, as well as restarting/upgrading/downgrading the daemon is less than desirable behavior on a host that has already been provisioned and has containers running on it.

Any plans in the future for such functionality to be implemented?? I'm investigating how I could use this method to link a Jenkins server into a docker host on a different server.

Agreed. A docker-machine add command would greatly facilitate this task.

The best alternative I've seen right now is to use docker-machine create -d none but this means lots of finicky work to create/copy/manage the certs.
See https://www.boerngen-schmidt.de/2017/05/connect-to-a-remote-docker-host-with-docker-machine-using-tls-certificates/

Yes please! Not having this is a really big problem.

I just ran into this as well. Was about to create a new bug - but I found this one.

From my perspective, I think what is needed is for the "none" driver to have some driver options to pass the keys and certs.

Something like:
--none-ca-cert=
--none-client-key=
--none-server-cert=

This would be way cleaner and easier than messing with the json directly. (Way easier to explain to others as well!)

Also, sometimes when talking to an existing engine it is an older version of Docker. It would be nice if docker-machine could also specify and set DOCKER_API_VERSION.

Maybe add the option:
--none-api-version=1.23

Then docker-machine env would also spit out DOCKER_API_VERSION=1.23
(And maybe COMPOSE_API_VERSION as well.)

Looking to see if there is any update or action regarding this issue.

I am currently trying to resolve the same thing.
I have multiple VM's running docker engine that I would like to manage as a swarm via docker-machine without renaming the current hosts and upgrading their docker engine api versions.

Was this page helpful?
0 / 5 - 0 ratings