andrewchilds / overcast

Orchestrate VMs from your terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Docker as a provider

rehanift opened this issue · comments

I use Docker instead of Vagrant/VirtualBox for local development.

Is there an interface/specification for creating new providers? I'd like to try and create one for Docker containers.

That's a great idea 👍 👍

The existing providers were all built ad-hoc - I would like to clean that up since behavior and code style across the existing providers are pretty divergent, but I probably won't be getting to that in the near future. That said, if you want to dig in, modules/commands/virtualbox.js is pretty close to how the code would look if there was a common interface, so I would use that as a starting point.

Hi Rehan, I've just finished cleaning up the codebase and creating a standard provider interface. There is still API complexity under the hood in each modules/providers/[provider].js, but there is an abstraction layer between the code that talks to the provider API and the standardized modules/provider.js file, which is now used by all of the provider commands.

If you are still interested in working on a Docker provider, there are a bunch of assumptions that I'm not comfortable making without getting some feedback from people that would use this, for example...

  1. Would you limit this to linux users only and require a docker binary, or do you also look for and support boot2docker users?

  2. How will provider commands work using Docker? I would expect them to behave like any other provider - meaning that I can create an instance (or container), run commands on it, ssh in, reboot, push/pull files, etc. The minimum command list would probably be:

    overcast docker boot [name]
    overcast docker create [name] [options...]
    overcast docker destroy [name] [options...]
    overcast docker reboot [name]
    overcast docker shutdown [name]