Understanding a plugin
So far, we have established that all the plugins that we have installed have actually nothing to do with Docker directly, so what does a plugin do?
Docker describes a plugin as:
"Docker plugins are out-of-process extensions which add capabilities to the Docker Engine."
This is exactly what we have seen when installing third-party tools, they all run alongside Docker as separate daemons.
Let's assume that we are going to be creating a volume plugin called mobyfs
for the remainder of this chapter. The mobyfs plugin is a fictional service which is written in Go and it runs as a daemon.
Discovery
Typically, a plugin will be installed on the same host as the Docker binary. We can register our mobyfs plugin with Docker by creating the following files in either /run/docker/plugins
if it's a Unix socket file, or /etc/docker/plugins
or /usr/lib/docker/plugins
if it is one of the other two files:
mobyfs.sock
mobyfs.spec
mobyfs.json
Plugins that use a Unix socket file...