dotcloud/docker — pull request #5649 by zinic (2014-05-07 08:24:03+00:00)
Title: 5648 Docker CLI Enhancements (Remotes and Plugins)

## Docker CLI Enhancements

### Docker CLI Remotes

[Docker CLI Remotes](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/client/remote.go) are pluggable components that abstract away both the connection and communication logic for command execution. A Docker CLI Remote must implement the following:

* A Dial method for establishing a network connection to a remote target.
* A Call method for executing the command against a network connection to a remote target.

[The default (HTTP) remote is available for reference.](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/plugins/http/remote.go)

### Docker CLI Plugins

[Docker CLI Plugins](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/client/plugin.go) are pluggable components that allow for uniform client-side extension of Docker commands. This is accomplished by the addition of a before and after hook in the [CLI command lookup and execution code](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/client/cli.go#L120-L147).

Plugins are managed by the [inclusion](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/docker/docker.go#L15) of the [plugins package](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/plugins/plugins.go).

### Minor Refactorings

* [Members of the DockerCli struct made public for use in remotes and plugins.](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/client/cli.go#L164-L177)
* [Relocation of HTTP call logic to its own HTTP remote implementation.](https://github.com/zinic/docker/blob/5648-docker-remotes-and-plugins/api/plugins/http/remote.go)