Docker Community Forums

Share and learn in the Docker community.

Is it posible to register a previously made VM?


(Lordscales91) #1

The default VM created by docker-machine is good but it’s tied to Boot2docker, which is not customizable at all. I would like to be able to use my own VM, for example one based on Ubuntu, with docker installed and the ssh port exposed. This would allow me to:

  • Freely add Virtualbox Shared Folders with automount.
  • Install some service directly on the VM

And why I would like to install a service directly on the VM instead of using a Docker container?
The reason is simple, I plan to use Docker in production and I would like to have the following hierarchy:

Nginx used as a front-end web server acting as a reverse proxy to redirect the requests to the proper container. Define folders on the host for static files shared between containers as volumes. That’s why I want that setup, in case the docker daemon fails at least Nginx should be able to display a custom error page. And finally, of course, there will be dockerized web apps running inside their own containers.

So, in order to emulate the mentioned setup on non-Linux platforms, being able to use a custom VM would be very helpful.


(Jeff Anderson) #2

I have a few ubuntu and debian VMs that I’ve created manually, and added to docker-machine with the generic driver.

docker-machine create -d generic --help --generic-ip-address <hostorip> --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user ubuntu myubuntubox

Basically, it will ssh in to the hostname or ip that you specify, install docker, and set up the certificates.

Docker-machine 0.7.0 was just released today, https://github.com/docker/machine/tree/v0.7.0

It does have some enhancements to the virtualbox driver, including some options that allow you to control the networking setup a bit more than you were able to before. (I’m not sure what customizations you might be after, but that’s a common pain point)

/Jeff


(Lordscales91) #3

Thanks for your answer. I didn’t noticed the generic driver before posting. Actually I spotted it a bit later taking a closer look to the docs, but I was unable to properly configure SSH keys http://stackoverflow.com/questions/6377009 I don’t think it was because of permissions problems since the default permissions are 755 (and I didn’t used sudo)