Open prologic opened 8 years ago
Hey @prologic. No formal specification so far (unfortunately :( ) but essentially the idea is you need to implement the Driver
interface and then call plugin.RegisterDriver()
for your Driver
in your plugin binary's main
method. Have you looked at some of the linked 3rd party plugins?
@nathanleclaire Thanks for responding! I've looked at various 3rd-party (not packaged with docker-machine
) however I was under the impression from various issues and pull-requests that the way docker-machine driver plugins worked was language agnostic? (or at least meant to be?)
Is this not the case?
@prologic No, it's pretty tightly coupled to Golang net/rpc
.
But it's an RPC and talks over a socket no? :) What am I missing :P
@prologic It's built using https://golang.org/pkg/net/rpc/ and the transport codec is gob
, which is the native Go blob encoding format. It might be possible to communicate using gob
in other languages (see https://groups.google.com/forum/#!topic/golang-nuts/xtXh0yWOens for instance), but it might be more trouble than its worth.
In order to be truly language-agnostic we'd have to use something like JSON-RPC or protobufs which is designed for that specifically. It's definitely something I'm taking into consideration for the future, but would require a version bump on the plugin API (it wouldn't be backwards or forwards compatible).
Bump!
Is there a document/pr/issue that describes the RPC Interface for driver plugins? I found a few related issues #1626 and #1902 but I'm struggling to find something more "concrete; there isn't anything in docs that I can see?