Moves graphdriver plugn docs out of experimental

Also updates some of the structures being sent so plugins are getting
all the new options.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2016-11-19 11:41:07 -05:00 committed by Tibor Vass
parent b5b3dd4c6b
commit a59544ff3d
1 changed files with 85 additions and 43 deletions

View File

@ -1,12 +1,42 @@
# Experimental: Docker graph driver plugins ---
title: "Graphdriver plugins"
description: "How to manage image and container filesystems with external plugins"
keywords: "Examples, Usage, storage, image, docker, data, graph, plugin, api"
advisory: experimental
---
<!-- This file is maintained within the docker/docker Github
repository at https://github.com/docker/docker/. Make all
pull requests against that repo. If you see this file in
another repository, consider it read-only there, as it will
periodically be overwritten by the definitive file. Pull
requests which include edits to this file in other repositories
will be rejected.
-->
## Changelog
### 1.13.0
- Support v2 plugins
# Docker graph driver plugins
Docker graph driver plugins enable admins to use an external/out-of-process Docker graph driver plugins enable admins to use an external/out-of-process
graph driver for use with Docker engine. This is an alternative to using the graph driver for use with Docker engine. This is an alternative to using the
built-in storage drivers, such as aufs/overlay/devicemapper/btrfs. built-in storage drivers, such as aufs/overlay/devicemapper/btrfs.
A graph driver plugin is used for image and container filesystem storage, as such You need to install and enable the plugin and then restart the Docker daemon
the plugin must be started and available for connections prior to Docker Engine before using the plugin. See the following example for the correct ordering
being started. of steps.
```
$ docker plugin install cpuguy83/docker-overlay2-graphdriver-plugin # this command also enables the driver
<output supressed>
$ pkill dockerd
$ dockerd --experimental -s cpuguy83/docker-overlay2-graphdriver-plugin
```
# Write a graph driver plugin # Write a graph driver plugin
@ -22,20 +52,30 @@ expected to provide the rootfs for containers as well as image layer storage.
### /GraphDriver.Init ### /GraphDriver.Init
**Request**: **Request**:
``` ```json
{ {
"Home": "/graph/home/path", "Home": "/graph/home/path",
"Opts": [] "Opts": [],
"UIDMaps": [],
"GIDMaps": []
} }
``` ```
Initialize the graph driver plugin with a home directory and array of options. Initialize the graph driver plugin with a home directory and array of options.
Plugins are not required to accept these options as the Docker Engine does not These are passed through from the user, but the plugin is not required to parse
require that the plugin use this path or options, they are only being passed or honor them.
through from the user.
The request also includes a list of UID and GID mappings, structed as follows:
```json
{
"ContainerID": 0,
"HostID": 0,
"Size": 0
}
```
**Response**: **Response**:
``` ```json
{ {
"Err": "" "Err": ""
} }
@ -47,20 +87,21 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Create ### /GraphDriver.Create
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142" "Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142",
"MountLabel": "" "MountLabel": "",
"StorageOpt": {}
} }
``` ```
Create a new, empty, read-only filesystem layer with the specified Create a new, empty, read-only filesystem layer with the specified
`ID`, `Parent` and `MountLabel`. `Parent` may be an empty string, `ID`, `Parent` and `MountLabel`. If `Parent` is an empty string, there is no
which would indicate that there is no parent layer. parent layer. `StorageOpt` is map of strings which indicate storage options.
**Response**: **Response**:
``` ```json
{ {
"Err": "" "Err": ""
} }
@ -71,11 +112,12 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.CreateReadWrite ### /GraphDriver.CreateReadWrite
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142" "Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142",
"MountLabel": "" "MountLabel": "",
"StorageOpt": {}
} }
``` ```
@ -84,7 +126,7 @@ Similar to `/GraphDriver.Create` but creates a read-write filesystem layer.
### /GraphDriver.Remove ### /GraphDriver.Remove
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187" "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187"
} }
@ -93,7 +135,7 @@ Similar to `/GraphDriver.Create` but creates a read-write filesystem layer.
Remove the filesystem layer with this given `ID`. Remove the filesystem layer with this given `ID`.
**Response**: **Response**:
``` ```json
{ {
"Err": "" "Err": ""
} }
@ -104,9 +146,9 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Get ### /GraphDriver.Get
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187" "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"MountLabel": "" "MountLabel": ""
} }
``` ```
@ -114,7 +156,7 @@ Respond with a non-empty string error if an error occurred.
Get the mountpoint for the layered filesystem referred to by the given `ID`. Get the mountpoint for the layered filesystem referred to by the given `ID`.
**Response**: **Response**:
``` ```json
{ {
"Dir": "/var/mygraph/46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "Dir": "/var/mygraph/46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Err": "" "Err": ""
@ -127,7 +169,7 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Put ### /GraphDriver.Put
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187" "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187"
} }
@ -137,7 +179,7 @@ Release the system resources for the specified `ID`, such as unmounting the
filesystem layer. filesystem layer.
**Response**: **Response**:
``` ```json
{ {
"Err": "" "Err": ""
} }
@ -148,7 +190,7 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Exists ### /GraphDriver.Exists
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187" "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187"
} }
@ -157,7 +199,7 @@ Respond with a non-empty string error if an error occurred.
Determine if a filesystem layer with the specified `ID` exists. Determine if a filesystem layer with the specified `ID` exists.
**Response**: **Response**:
``` ```json
{ {
"Exists": true "Exists": true
} }
@ -169,14 +211,14 @@ Respond with a boolean for whether or not the filesystem layer with the specifie
### /GraphDriver.Status ### /GraphDriver.Status
**Request**: **Request**:
``` ```json
{} {}
``` ```
Get low-level diagnostic information about the graph driver. Get low-level diagnostic information about the graph driver.
**Response**: **Response**:
``` ```json
{ {
"Status": [[]] "Status": [[]]
} }
@ -189,7 +231,7 @@ information.
### /GraphDriver.GetMetadata ### /GraphDriver.GetMetadata
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187" "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187"
} }
@ -199,7 +241,7 @@ Get low-level diagnostic information about the layered filesystem with the
with the specified `ID` with the specified `ID`
**Response**: **Response**:
``` ```json
{ {
"Metadata": {}, "Metadata": {},
"Err": "" "Err": ""
@ -213,15 +255,15 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Cleanup ### /GraphDriver.Cleanup
**Request**: **Request**:
``` ```json
{} {}
``` ```
Perform necessary tasks to release resources help by the plugin, for example Perform necessary tasks to release resources help by the plugin, such as
unmounting all the layered file systems. unmounting all the layered file systems.
**Response**: **Response**:
``` ```json
{ {
"Err": "" "Err": ""
} }
@ -233,7 +275,7 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.Diff ### /GraphDriver.Diff
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142" "Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142"
@ -251,7 +293,7 @@ and `Parent`. `Parent` may be an empty string, in which case there is no parent.
### /GraphDriver.Changes ### /GraphDriver.Changes
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142" "Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142"
@ -259,10 +301,10 @@ and `Parent`. `Parent` may be an empty string, in which case there is no parent.
``` ```
Get a list of changes between the filesystem layers specified by the `ID` and Get a list of changes between the filesystem layers specified by the `ID` and
`Parent`. `Parent` may be an empty string, in which case there is no parent. `Parent`. If `Parent` is an empty string, there is no parent.
**Response**: **Response**:
``` ```json
{ {
"Changes": [{}], "Changes": [{}],
"Err": "" "Err": ""
@ -270,7 +312,7 @@ Get a list of changes between the filesystem layers specified by the `ID` and
``` ```
Respond with a list of changes. The structure of a change is: Respond with a list of changes. The structure of a change is:
``` ```json
"Path": "/some/path", "Path": "/some/path",
"Kind": 0, "Kind": 0,
``` ```
@ -300,7 +342,7 @@ and `Parent`
- parent (required)- the `Parent` of the given `ID` - parent (required)- the `Parent` of the given `ID`
**Response**: **Response**:
``` ```json
{ {
"Size": 512366, "Size": 512366,
"Err": "" "Err": ""
@ -313,7 +355,7 @@ Respond with a non-empty string error if an error occurred.
### /GraphDriver.DiffSize ### /GraphDriver.DiffSize
**Request**: **Request**:
``` ```json
{ {
"ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187", "ID": "46fe8644f2572fd1e505364f7581e0c9dbc7f14640bd1fb6ce97714fb6fc5187",
"Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142" "Parent": "2cd9c322cb78a55e8212aa3ea8425a4180236d7106938ec921d0935a4b8ca142"
@ -323,7 +365,7 @@ Respond with a non-empty string error if an error occurred.
Calculate the changes between the specified `ID` Calculate the changes between the specified `ID`
**Response**: **Response**:
``` ```json
{ {
"Size": 512366, "Size": 512366,
"Err": "" "Err": ""