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!
Most helpful comment
@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 usinggob
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).