efrecon / docker-s3fs-client

Alpine-based s3fs client: mount from container, make available to other containers
BSD 3-Clause "New" or "Revised" License
173 stars 62 forks source link

Is manual unmount required? #48

Closed juaoose closed 1 year ago

juaoose commented 1 year ago

I am creating 2 containers:

  1. s3fs-client container that binds to -v /mnt/tmp/myFolder:/opt/s3fs/bucket:rshared
  2. nginx container that uses the s3 directory from the host -v /mnt/tmp/myFolder/:/s3data:rw

After I stop and kill both containers and look at the /mnt/tmp/myFolder folder, it will usually throw:

/mnt/tmp# ls
ls: cannot access 'myFolder': Transport endpoint is not connected

Until I do fusermount -u myFolder. Is this the expected way to do it? Or are there any recomendations?

Note: The /mnt/tmp/ was mounted like this (if it could matter)

sudo mount -o bind /mnt/tmp /mnt/tmp
sudo mount --make-shared /mnt/tmp

Thank you.

efrecon commented 1 year ago

You have to stop the containers before removing them, so: don't docker rm -f them. This is because, when stopping, a gracefull termination signal will be sent to the process being run by the entrypoint in the end, i.e. empty.sh. I am closing this issue, feel free to reopen if it does not solve your problem.