Open wickeduk opened 4 years ago
Additional:
docker-compose version docker-compose version 1.25.1, build a82fef0 docker-py version: 4.2.0 CPython version: 3.6.10 OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
Not sure if this can be resolved. If I understand the problem correctly, the reason this is failing is that the encfs
filesystem is only accessible by the current user, and not accessible by other users.
When you bind-mount a directory (-v <host-path>:<container-path>
), that bind-mount is handled on the daemon side (and from the host on which the daemon runs); the daemon runs as another user (root
most likely), and probably doesn't have access to the files in that mount.
The reason docker is attempting to create the path, is that the short-hand -v <host-path>:<container-path>
notation for bind-mounts will attempt to create the host-path if it's missing (I suspect in this case it may get an error that it interprets as the path doesn't exist because it has no access).
You can try using the long-form (--mount src=/host/path,dest=/container-path
) notation (or the equivalent in compose: https://docs.docker.com/compose/compose-file/#volumes, which is available on compose-file version 3.2 and up), which won't attempt to create the host-path, but I suspect it would still fail if it doesn't have access to the decrypted files.
Perhaps it works if you try using the --public
for the encfs; https://unix.stackexchange.com/a/249318
Yes --public solves it.
There is also the comment on the encfs man page: Warning: In order for this to work, encfs must be run as root -- otherwise it will not have the ability to change ownership of files. I recommend that you instead investigate if the fuse allow_other option can be used to do what you want before considering the use of --public.
I'm not sure if that's --allow_other or something else but I'll give that a try as well.
Informed the user on the related issue to look to see if there is something similar for unionfs.
I guess it would be worth documenting the issue with user only mounted filesystems in a FAQ somewhere so others don't raise issues.
Other than that I think this is resolved now so can be closed.
Expected behavior
Docker-compose to start container
Actual behavior
Nonsense error - it shouldn't be trying to create a directory here, this is a base directory for the fuse encfs mountpoint for decrypted data
See other reports on win: https://github.com/docker/for-win/issues/5516 for similar incorrect outputs of this error
The error message doesn't make sense and probably should also be fixed to output the real problem
Probable duplicate (fuse being the common denominator): https://github.com/docker/for-linux/issues/936
This hasn't been looked at or commented on 6 months after it was raised, hence the need to raise a more general bug.
It's likely docker and fuse are not playing nicely. This is important as I wish to keep my client's code on an encrypted area of the disk in case of theft, and at the moment when docker-compose is run I need to move it outside that area.
Steps to reproduce the behavior
Cannot use my example (starting mq) as it belongs to a client, but can reuse example in:
https://github.com/docker/for-linux/issues/936
Behaviour of demo Container doesn't start while inside (either project/cwd or both?) encfs mountpoint, move it outside it's happy, move it back inside it fails again.
dec is a an encfs created mountpoint (decrypted directory) - create with encfs
e.g.
encfs /home/dav/work/enc /home/dav/work/dec
enter then enter password twice
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)