1

I have a data set stashed in /vms1/thoth/new_maplab_shared, but when I

$ docker run -it --mount type=bind,source=/vms1/thoth/new_maplab_shared,target=/new_maplab_shared edd5afa10b5f
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /vms1/thoth/new_maplab_shared.
See 'docker run --help'.
$ ls -l /vms1/thoth/new_maplab_shared
total 4148912
-rw-rw-r-- 1 thoth thoth 2673031511 Mar 10  2021 MH_01_easy_ordered.bag
-rw-rw-r-- 1 thoth thoth 1571292346 Mar 10  2021 MH_01_easy.zip

The directory clearly exists. If I

# mount -o bind /vms1/thoth/new_maplab_shared /home/new_maplab_shared
$ docker run -it --mount type=bind,source=/home/new_maplab_shared,target=/new_maplab_shared edd5afa10b5f
root@5d2bbc6202b1:/# ls /new_maplab_shared/
MH_01_easy.zip  MH_01_easy_ordered.bag

it works.

What is going on here, and how can I eliminate the bind mount kludge on the host?

2
  • How are you running docker? Snap?
    – BMitch
    Sep 28 at 19:04
  • which docker reports /snap/bin/docker; and snap list | grep docker shows I have version 20.10.8
    – Mutant Bob
    Sep 30 at 16:55
2

Snaps are a layer of isolation, similar to containers, that prevent access to the entire host filesystem. User home directories are mounted into the snaps which gives you access to those folders. If you were to install docker outside of a snap, you should have access to mount other host directories into the container.

0

I went searching for a way to give my docker snap access to the directory, but found a couple of other stackexchange questions that lead me to believe it is not currently possible:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.