Volume Plugins
Docker volumes are mounted to containers to allow stateful applications to run in containers. By default, volumes are created in the filesystem of the host machine and managed by Docker. In addition, while creating a volume, it is possible to specify a volume driver. For instance, you can mount volumes over network or storage providers such as Google, Azure, or AWS. You can also run your database locally in Docker containers while the data volumes are persistent in AWS storage services. This way, your data volumes can be reused in the future with other database instances running in any other location. To use different volume drivers, you need to enhance Docker with volume plugins.
Docker volume plugins control the life cycle of volumes, including the Create
, Mount
, Unmount
, Path
, and Remove
functions. In the plugin SDK, the volume driver interface is defined as follows:
// Driver represent the interface a driver must fulfill. type Driver interface { ...