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.
# yum install docker
# yum install objectivefs-6.7.1-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_6.7.1_amd64.deb
# apt install ./objectivefs-docker-volume_1.0_amd64.deb
# service objectivefs-docker-volume start
# /usr/lib/docker/objectivefs-docker-volume
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>
ofsvol1
volume on dir
inside the container.# docker run -it -v ofsvol1:<dir> busybox /bin/sh
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>
ofsvol2
volume on dir
inside the container.# docker run -it -v ofsvol2:<dir> busybox /bin/sh
/etc/objectivefs.env/
contains your license key, filesystem passphrase and AWS keys. The AWS keys are not needed if you are using IAM role.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
ofsvol3
with your filesystem name and mount options.# docker volume create --driver=objectivefs ofsvol2 -ofs=<filesystem name> -ooptions=<mount options>
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.# docker volume ls
2. Remove volume driver
# docker volume rm <volume id>
3. List all containers
# docker ps -a
4. Remove a containers with container id
# docker rm <container id>
Last updated by ObjectiveFS staff, July 9, 2020
ObjectiveFS is a shared file system for macOS and Linux that automatically scales and gives you scalable cloud storage.
If you have questions or article idea suggestions, please email us at support@objectivefs.com