The ObjectiveFS Docker volume plugin lets you use your ObjectiveFS filesystem inside Docker containers. This document describes the steps to create and use an ObjectiveFS docker volume.
Both ObjectiveFS and the ObjectiveFS Docker volume plugin packages are installed.
a. CentOS/RedHat:
$ yum install docker
$ yum install objectivefs-7.2-1.x86_64.rpm
$ yum install objectivefs-docker-volume-1.0-1.x86_64.rpm
$ service objectivefs-docker-volume start
$ service docker start
b. Ubuntu
$ apt install docker.io
$ apt install ./objectivefs_7.2_amd64.deb
$ apt install ./objectivefs-docker-volume_1.0_amd64.deb
$ service objectivefs-docker-volume start
An ObjectiveFS filesystem has been created (see get started).
[If not using systemd] Run the driver directly, preferably as a daemon.
$ /usr/lib/docker/objectivefs-docker-volume
A. Create a Docker Volume on EC2 instances with IAM role attached
Create a volume plugin called ofsvol1
with your filesystem name, license key and filesystem passphrase.
$ docker volume create –driver=objectivefs ofsvol1 -ofs=<filesystem name>
-oOBJECTIVEFS_LICENSE=<license> -oOBJECTIVEFS_PASSPHRASE=<fs passphrase>
-ooptions=<mount options>
Mount the ofsvol1
volume on dir
inside the container.
$ docker run -it -v ofsvol1:<dir> busybox /bin/sh
B. Create a Docker Volume with Keys
Create a volume plugin called ofsvol2
with your filesystem name, license key, filesystem passphrase and AWS keys.
# docker volume create –driver=objectivefs ofsvol2 -ofs=<filesystem name>
-oOBJECTIVEFS_LICENSE=<license> -oOBJECTIVEFS_PASSPHRASE=<fs passphrase>
-oAWS_ACCESS_KEY_ID=<aws access key> -oAWS_SECRET_ACCESS_KEY=<secret key>
-ooptions=<mount options>
Mount the ofsvol2
volume on ddir
inside the container.
$ docker run -it -v ofsvol2:<dir> busybox /bin/sh
C. Create a Docker Volume with /etc/objectivefs.env
Check that /etc/objectivefs.env/
contains your license key, filesystem passphrase and AWS keys. The AWS keys are not needed if you are using IAM role.
Note: You can also have other ObjectiveFS environment variables in this directory such as CACHESIZE
and they will also be used by the plugin.
$ ls /etc/objectivefs.env/
AWS_ACCESS_KEY_ID OBJECTIVEFS_PASSPHRASE
AWS_SECRET_ACCESS_KEY OBJECTIVEFS_LICENSE
Create a volume plugin called ofsvol3
with your filesystem name and mount options.
docker volume create –driver=objectivefs ofsvol2 -ofs=<filesystem name> -ooptions=<mount options>
Mount the ofsvol3
volume on dir
inside the container.
$ docker run -it -v ofsvol3:<dir> busybox /bin/sh
Usage:
$ docker volume create \
--driver=objectivefs <docker vol id> \
--ofs=<filesystem name> \
[-o<OBJECTIVEFS_ENV_VAR>=<value>] \
[-ooptions=<mount options>] \
[-oasap]
-o<OBJECTIVEFS_ENV_VAR>=<value>
.
/etc/objectivefs.env/
.
mt, noatime
can be set in the mount options field.
-ooptions=mt,noatime
.
-oasap
option will unmount the filesystem as soon as there is no running container using the volume. Normally, the filesystem is unmounted when the volume is removed.
-oasap
option can be if you don’t need to access the filesystem again on this server. Otherwise, keeping the filesystem mounted can provide faster container startup time.
List all available volumes
$ docker volume ls
Remove volume driver
$ docker volume rm <volume id>
List all containers
$ docker volume ps -a
Remove a containers with container id
$ docker rm <volume id>
取り扱いが容易で、しかも安全な S3 ファイルシステム
14日間無料でお試しください