Skip to content

vikas-goel/filevol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker filevol plugin

Docker Volume Driver for filevol volumes

This plugin can be used to create filevol volumes of specified size, which can then be bind mounted into the container using docker run command.

Setup

1) cd docker-filevol-plugin
2) make
3) sudo make install

Usage

  1. Start the docker daemon before starting the docker-filevol-plugin daemon. You can start docker daemon using command:
sudo systemctl start docker
  1. Once docker daemon is up and running, you can start docker-filevol-plugin daemon using command:
sudo systemctl start docker-filevol-plugin

NOTE: docker-filevol-plugin daemon is on-demand socket activated. Running docker volume ls command will automatically start the daemon.

  1. Add volume path in the config file
/etc/docker/filevol-plugin

Volume Creation

docker volume create command supports the creation of regular volumes, thin volumes, snapshots of regular and thin volumes.

Usage: docker volume create [OPTIONS] [VOLUME]

-d, --driver    string    Specify volume driver name (default "local")
--label         list      Set metadata for a volume (default [])
-o, --opt       map       Set driver specific options (default map[])

Following options can be passed using -o or --opt

--opt size
--opt source

Please see examples below on how to use these options.

Examples

$ docker volume create -d filevol --opt size=208896 foobar

This will create a filevol volume named foobar of size 208 MB (0.2 GB).

docker volume create -d filevol --name foobar_snapshot --opt source=foobar

This will create a snapshot volume of foobar named foobar_snapshot.

Volume List

Use docker volume ls --help for more information.

$ docker volume ls

This will list volumes created by all docker drivers including the default driver (local).

Volume Inspect

Use docker volume inspect --help for more information.

$ docker volume inspect foobar

This will inspect foobar and return a JSON.

[
    {
        "Driver": "filevol",
        "Labels": {},
        "Mountpoint": "/var/lib/docker-filevol-plugin/foobar",
        "Name": "foobar",
        "Scope": "local"
    }
]

Volume Removal

Use docker volume rm --help for more information.

$ docker volume rm foobar

This will remove filevol volume foobar.

Bind Mount filevol volume inside the container

$ docker run -it -v foobar:/home fedora /bin/bash

This will bind mount the logical volume foobar into the home directory of the container.

About

Docker volume plugin for a fixed size file as a volume.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published