- Notifications
You must be signed in to change notification settings - Fork9
S3 volume for docker based on goofys
License
monder/goofys-docker
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
goofys-docker is a dockervolume plugin wrapper for S3
The inital idea behind mounting s3 buckets as docker volumes is to provide store for configs and secrets. The volume as pergoofys does not have features like randow-write support, unix permissions, caching.
The docker host should haveFUSE support withfusermount
cli utility in$PATH
There are prebuilt binaries availblehere. If you need to build it yourself there is a helper filebuild.sh
that will run a container that builds the application using go 1.5. Version 1.5 is used to workaroundmoby/moby#20865
Currently there is no support for configuration options, but the defaults are reasonable for most of the cases.The most simple way to configure aws credentials is to useIAM roles to access the bucket for the machine,aws configuration file orENV variables. The credentials will be used for all buckets mounted bygoofys-docker
.
./goofys-docker
The socket/run/docker/plugins/goofys.sock
will be created to interact with docker. Ownership of the file isroot:wheel
Create a new volume by issueing a docker volume command:
docker volume create --name=test-docker-goofys --driver=goofys
That will create a volume connected totest-docker-goofys
bucket. The region of the bucket will be autodetected.
Nothing is mounted yet.
Launch the container withtest-docker-goofys
volume mounted in/home
inside the container
docker run -v test-docker-goofys:/home:ro -it busybox sh/ # cat /home/testtest file content/ # ^D
It is also possible to mount a subfolder:
docker volume create --name=test-docker-goofys/folder --driver=goofysdocker run docker run -v test-docker-goofys/folder:/home:ro -it busybox sh/ # cat /home/testtest file content from folder/ # ^D
If multiple folders are mounted for the single bucket on the same machine, only 1 fuse mount will be created. The mount will be shared by docker containers. It will be unmouned when there be no containers to use it.
MIT
About
S3 volume for docker based on goofys