简体   繁体   English

提供s3fs mount到docker作为卷

[英]provide s3fs mount to docker as volume

I´d Like to use a mounted S3 Bucket (using s3fs) as a volume within a docker container. 我想使用已安装的S3 Bucket(使用s3fs)作为docker容器中的卷。

I have: a mounted S3 Bucket (with s3fs) at /mnt/bucketname on my ec2 Machine using: 我有:在我的ec2机器上的/ mnt / bucketname上安装了一个S3 Bucket(带有s3fs),使用:

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. 并且可以读取/ mnt / bucketname中的所有文件/文件夹。

This is the command i use to run my Docker Image (with interactive terminal): 这是我用来运行我的Docker镜像的命令(带有交互式终端):

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. 在Docker容器中,文件(应出现在/ test /中)不存在。

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? 有人使用s3fs挂载并将其作为卷提供给docker,或者这完全是错误的方法吗?

Thanks for any answers. 谢谢你的回答。

Sorry for Self-Answering - but i solved the problem by restarting the docker service: 对不起自我答复 - 但我通过重新启动docker服务解决了这个问题:

sudo service docker stop
sudo service docker start

and voila: the s3fs volume is accessible. 并且瞧:s3fs卷是可访问的。

best 最好

Flo 弗洛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM