goofys
goofys copied to clipboard
Files in S3 bucket don't appear in docker container
Hello all. I have been having problems with mounting a host directory (that has a S3 bucket mounted on using goofys) into a docker container running on an EC2 instance. I ran a docker container that created a bind-mount between the absolute path of the host directory containing the S3 bucket and a directory inside the container. However, the files in the S3 bucket do not appear inside the docker container directory that was specified yet a docker inspect shows that the bind-mounts were successful. Is this a goofys or a docker issue?
Might be a fuse issue. Have you tried mounting with allow_other
?
I've found that docker doesn't show files for mounts that occur after the daemon has been started. Try restarting the daemon and seeing if the mounts show files. We have this issue with goofys and with nfs so its not a goofys specific issue.
I do want to make goofys work better in the docker world so suggestions about what it can do better is highly welcomed. Note that I will be traveling for the next two weeks and responses maybe sparse.
It could be interesting to official support https://github.com/monder/goofys-docker directly in this repository.
I was getting this error, when I ran docker run with the -v mount:
docker: Error response from daemon: error while creating mount source path '<goofys_mount>': mkdir <goofys_mount>: file exists.
These 3 things fixed it:
- /etc/fuse.conf needs to have "user_allow_other"
- "-o allow_other" option needs to be passed to Goofys when mounting the S3 bucket
- "--privileged --cap-add=SYS_ADMIN --device /dev/fuse" need to be passed during the docker run statement
Easying it for the next one:
s3fs:
container_name: s3fs
image: gseldon/goofys:latest
restart: unless-stopped
deploy:
mode: replicated
replicas: 1
placement:
max_replicas_per_node: 1
constraints:
- "node.role == manager"
cap_add:
- SYS_ADMIN
security_opt:
- "apparmor:unconfined"
devices:
- /dev/fuse
volumes:
- /mnt/storage:/mnt/storage:rshared
- /var/s3fs/docker/etc/fuse.conf:/etc/fuse.conf:ro
- /var/s3fs/docker/root/.aws/credentials:/root/.aws/credentials:ro
environment:
ENDPOINT: https://nyc3.digitaloceanspaces.com
BACKETNAME: mystorage
MOUNTPOINT: /mnt/storage
UID: 1000
GID: 1000
FILEMOD: 0664
DIRMODE: 0774
S3FS_ARGS: -o allow_other