-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amazon S3 volume plugin #39
Conversation
@marcelo-ochoa Why don't you fork this project? I haven't worked on this project for a while. |
Thanks for your quick reply, I think is better to maintain the original one because is best ranked hub.docker.com. Marcelo. |
I just made you a collaborator. Feel free to work on this then :) |
Thanks!! |
S3Fs Volume Plugin
This is a managed Docker volume plugin to allow Docker containers to access S3Fs volumes. The S3Fs client does not need to be installed on the host and everything is managed within the plugin.
Caveats:
--alias
when installing the plugin.--alias
to define separate instancesAWSACCESSKEYID/AWSSECRETACCESSKEY
is initially blank it needsdocker plugin s3fs set AWSACCESSKEYID=key;docker plugin s3fs set AWSSECRETACCESSKEY=secret
if it is set then it will be used for all buckets and low level options will not be allowed. Primarily this is to control what the deployed stacks can perform.Operating modes
There are three operating modes listed in order of preference. Each are mutually exclusive and will result in an error when performing a
docker volume create
if more than one operating mode is configured.Just the name
This is the recommended approach for production systems as it will prevent stacks from specifying any random server. It also prevents the stack configuration file from containing environment specific key/secrets and instead defers that knowledge to the plugin only which is set on the node level. This relies on
AWSACCESSKEYID/AWSSECRETACCESSKEY
being configured and will use the name as the volume mount set bydocker plugin set
. This can be done in an automated fashion as:If there is a need to have a different set of key/secrets, a separate plugin alias should be created with a different set of key/secrets.
Example in docker-compose.yml:
The
volumes.x.name
specifies the bucket and optionally a subdirectory mount. The value ofname
will be used as the-o bucket=
and-o servicepath=
in s3fs fuse mount. Note thatvolumes.x.name
must not start with/
.Specify the s3fs driver opts
This uses the
driver_opts.s3fsopts
to define a comma separated list s3fs options. The rules for specifying the volume is the same as the previous section.Example in docker-compose.yml assuming the alias was set as
s3fs
:The
volumes.x.name
specifies the bucket and optionally a subdirectory mount. The value ofname
will be used as the-o bucket=
and-o servicepath=
. Note thatvolumes.x.name
must not start with/
. The values above correspond to the following mounting command:Specify the options
This passes the
driver_opts.s3fsopts
to thes3fs
command followed by the generated mount point. This is the most flexible method and gives full range to the options of the S3Fs FUSE client. Example in docker-compose.yml assuming the alias was set ass3fs
:The value of
name
will not be used for mounting; the value ofdriver_opts.s3fsopts
is expected to have all the volume connection information.Testing outside the swarm
This is an example of mounting and testing a store outside the swarm. It is assuming the server is called
store1
and the volume name istrajano
.Testing with Oracle Cloud Object storage
Sample usage Oracle Object Storage in S3 compatibilty mode, replace tenant_id and region_id with a proper value: