Docker Volume plugin to create persistent volumes in a sheepdog cluster.
The driver is based on the Docker Volume Plugin framework and it integrates sheepdog into the Docker ecosystem by automatically creating a iSCSI storage volume(tgt) to a sheepdog vdi and making the volume available to Docker containers running.
First create a volume:
$ docker volume create -d sheepdog vol1
In this case, it will be created with default volume size (DefaultVolSz
is be used. e.g. 10G
)
If you want to specify it explicitly, can use the -o size=
option.
The syntax is equivalent to the dog
command.(10G
, 10M
...)
For other options please check ours wiki.
$ docker volume create -d sheepdog vol1 -o size=12G
Then use the volume by passing the name (vol1
):
$ docker run -it -v vol1:/data docker.io/alpine sh
List the volume:
$ docker volume list
DRIVER VOLUME NAME
sheepdog vol1
Inspect the volume:
$ docker volume inspect vol1
[
{
"Driver": "sheepdog",
"Labels": {},
"Mountpoint": "/mnt/sheepdog/vol1",
"Name": "vol1",
"Options": {},
"Scope": "global"
}
]
Remove the volume:
$ docker volume rm vol1
- sheepdog cluster has to be set up and running
- install and start required service and software
- Docker Engine: 1.13.0+
sudo
command- xfsprogs (
mkfs.xfs
command) - iscsi-initiator-utils (
iscsiadm
command) - scsi-target-utils (
tgtadm
command) - sheepdog (
dog
command)
A pre-built binary as well as rpm
and deb
packages are available from the github release page.
Supported Distributions:
- RHEL based distributions 7.x (docker 1.13.x is provided in
docker-latest
package) - Ubuntu 16.04 LTS (Xenial)
Then install and start the service:
$ sudo yum install ./docker-volume-sheepdog-*.rpm
$ sudo systemctl start docker-volume-sheepdog
It uses govendor to manage dependencies.
$ go get -u github.com/kardianos/govendor
$ cd ${PATH-TO-GIT-REPO}
$ govendor sync
$ make
Example /etc/docker-volume-plugin.d/sheepdog.json
file:
{
"MountPoint": "/mnt/sheepdog",
"DefaultVolSz": "10G",
"VdiSuffix": "dvp"
}
Probably in most cases you will not need to change this setting. but if you need to change it, please check ours wiki.
MIT, please see the LICENSE file.
This repository and all files that are included in this, there is no relationship at all with the upstream and vendor.