This document outlines the basic Input-Process-Output flow of the volume plugin.
The LizardFS Docker plugin implements the Docker Plugin API. The Inputs to the program are requests made by the Docker daemon to the plugin. Request such as Plugin.Activate
, and VolumeDriver.Create
, will be sent by the Docker daemon to the the unix socket, /run/docker/plugins/lizardfs.sock
, and the LizardFS Docker plugin will process the request, take the required actions, and respond with an appropriate response.
These are the requests that Docker will make to the plugin over the Unix socket. All requests will be HTTP POST requests and may contain a JSON payload. The plugin's response to the request should also be a JSON payload if applicable. Details about these requests can be found in the Docker documentation for the Plugins API and the Volume Plugin API.
Empty payload.
REMOTE_PATH
environment variable ( /docker/volumes
by default) to /mnt/lizardfs
. This is where the docker volumes will be stored. The /mnt/lizardfs
directory will be referred to as the "volume root" throughout this document.{
"Implements": ["VolumeDriver"]
}
{
"Name": "volume_name",
"Opts": {
"ReplicationGoal": "replication_goal_number_or_name"
}
}
Name
. For example, /mnt/lizardfs/volume_name
.lizardfs setgoal
to set the replication goal for that Docker Volume to the value specified in the Opts
( if specified ).Error message ( if one occurred ).
{
"Err": ""
}
{
"Name": "volume_name"
}
Name
. For example, /mnt/lizardfs/volume_name
.Error message ( if one occurred ).
{
"Err": ""
}
{
"Name": "volume_name",
"ID": "b87d7442095999a92b65b3d9691e697b61713829cc0ffd1bb72e4ccd51aa4d6c"
}
Name
, such as /mnt/docker-volumes/volume_name
./docker/volumes/volume_name
) to the newly created mountpoint.ID
to the list of containers that have mounted Name
in the mounted_volumes
Javascript object. This variable is used to keep track of which containers have mounted the volume.We need to tell Docker where we mounted the volume or give an error message if there was a problem.
{
"Mountpoint": "/mnt/docker-volumes/volume_name",
"Err": ""
}
{
"Name": "volume_name"
}
Name
.Error message ( if one occurred ).
{
"Mountpoint": "/mnt/docker-volumes/volume_name",
"Err": ""
}
{
"Name": "volume_name",
"ID": "b87d7442095999a92b65b3d9691e697b61713829cc0ffd1bb72e4ccd51aa4d6c"
}
ID
from the list of containers that have mounted Name
in mounted_volumes
Javascript variable./mnt/docker-volumes/volume_name
because it no longer needs to be mounted.Error message ( if one occurred ).
{
"Err": ""
}
{
"Name": "volume_name"
}
volume_name
exists and that the process has read-write access.Return the volume name
{
"Volume": {
"Name": "volume_name",
"Mountpoint": "/mnt/docker-volumes/volume_name",
},
"Err": "Error if directory doesn't exist or we don't have read-write access to it."
}
{}
/mnt/lizardfs/
.Mountpoint
.Error message ( if one occurred ).
{
"Volumes": [
{
"Name": "volume_name",
"Mountpoint": "/mnt/docker-volumes/volume_name"
}
],
"Err": ""
}
{}
Not applicable.
{
"Capabilities": {
"Scope": "global"
}
}