Answers: <p>I went searching for a way to give my <code>docker</code> snap access to the directory, but found a couple of other stackexchange questions that lead me to believe it is not currently possible:</p>
  <ul>
  <li><a href="https://askubuntu.com/questions/964377/snap-application-doesnt-see-files-from-another-partition">https://askubuntu.com/questions/964377/snap-application-doesnt-see-files-from-another-partition</a></li>
  <li><a href="https://askubuntu.com/questions/1033344/how-to-give-snaps-access-to-somedir">https://askubuntu.com/questions/1033344/how-to-give-snaps-access-to-somedir</a></li>
  </ul>
  
Answers: CC BY-SA 4.0
Answers: 2021-10-01T16:14:16.550Z
Answers: 2021-10-01T16:14:16.550Z
Answers: Mutant Bob
Answers: <p>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.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-09-30T19:43:20.460Z
Answers: 2021-09-30T19:43:20.460Z
Answers: BMitch
Body: <p>I have a data set stashed in <code>/vms1/thoth/new_maplab_shared</code>, but when I</p>
  <pre><code>$ 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 &quot;bind&quot;: 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
  </code></pre>
  <p>The directory clearly exists.  If I</p>
  <pre><code># 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
  </code></pre>
  <p>it works.</p>
  <p>What is going on here, and how can I eliminate the bind mount kludge on the host?</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-09-28T19:04:43.200Z
Comments: How are you running docker? Snap?
Comments: BMitch
Comments: CC BY-SA 4.0
Comments: 2021-09-30T16:55:17.980Z
Comments: `which docker` reports /snap/bin/docker; and `snap list | grep docker` shows I have version 20.10.8
Comments: Mutant Bob
Tags: <docker>
Title: docker ... invalid mount config for type "bind": bind source path does not exist: but the source path does exist
UserDisplayName: Mutant Bob
ThreadText: # docker ... invalid mount config for type "bind": bind source path does not exist: but the source path does exist
  
  (Asked by: username_0 on 2021-09-28)
  
  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?
  
  **Tags:** docker
  
  > **Comments:**
  > **username_1**: How are you running docker? Snap?  
  > **username_0**: `which docker` reports /snap/bin/docker; and `snap list | grep docker` shows I have version 20.10.8  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-09-30. Score: 3 | Accepted answer
  
  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.
  
  
  ---
  
  ### Answer by username_0 on 2021-10-01. Score: 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:
  
  * <https://askubuntu.com/questions/964377/snap-application-doesnt-see-files-from-another-partition>
  * <https://askubuntu.com/questions/1033344/how-to-give-snaps-access-to-somedir>
  
  
  ---
  
  