Docker Community Forums

Share and learn in the Docker community.

S3fs Mount as Volume for Docker Image (Docker run -v)

docker
aws
amazonwebservices

(1122331133) #1

Hello Everyone !

i hope this is the right place to ask the question:

I´d Like to use a mounted S3 Bucket (using s3fs) as a volume within a docker container.

I have: a mounted S3 Bucket (with s3fs) at /mnt/bucketname on my ec2 Machine using:

sudo /usr/bin/s3fs -o allow_other,uid=500,umask=227,gid=500 bucketname /mnt/bucketname
and can read all files/folders in /mnt/bucketname.

This is the command i use to run my Docker Image (with interactive terminal):

sudo docker run -v /mnt/bucketname:/test -it Imagename /bin/bash
Within the Docker Container, the files (which should appear in /test/) are not present.

What might be the problem here?

Did someone use a s3fs mount and provide it to docker as a volume before or is this entirely the wrong way to do it?

Thanks for any answers

/edit:
Version:
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.3
Git commit: 7392c3b/1.12.6
Built: Tue Mar 7 20:34:04 2017
OS/Arch: linux/amd64

Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.3
Git commit: 7392c3b/1.12.6
Built: Tue Mar 7 20:34:04 2017
OS/Arch: linux/amd64

best regards


(Thiago Alves) #2

sudo docker run -v /mnt/bucketname:/test:shared -it Imagename /bin/bash

Does this work?