# Dynamic share mount into docker

By using bind mounts within the stack/compose configuration, it is possible to mount the root /mnt mount point into the docker environment. This means when a new share will be added on the host side, this will be available in the docker system.

The file or directory does not need to exist on the Docker host already. It is created on demand if it does not yet exist. Bind mounts are very performant, but they rely on the host machine’s filesystem having a specific directory structure available.

{% hint style="warning" %}
Please use this function with caution!\
\
The automatic/dynamic mounting of all sub-folders can be a security risk.\
\
\&#xNAN;***Please clarify this internally with your IT department beforehand.***
{% endhint %}

The changes for this are very easy and straight forward:

<figure><img src="/files/pDaYBnxLpIeEX5wDncl4" alt=""><figcaption><p>Volume mounting via bind</p></figcaption></figure>

Consider that the default basic /mnt:/Volumes mounting needs to be removed or changed to a comment, as this would lead to an issue when deploying the stack.

<details>

<summary>Configuration example docker bind</summary>

```json
volumes:
      - type: bind
        bind:
          propagation: rslave
        source: /mnt
        target: /Volumes
      
      #- /mnt:/Volumes
      
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro     
      
```

</details>

<figure><img src="/files/Z9b8OSukj2s2GRjmcD1S" alt=""><figcaption><p>Demonstration of dynamic share mount in docker</p></figcaption></figure>

{% hint style="info" %}
**For further information and assistance, here are the Docker references**\
\
[https://docs.docker.com/storage/bind-mounts](https://docs.docker.com/storage/bind-mounts/)\
<https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helmut.de/helmut4-releases/v4.6.2/getting-started/misc/dynamic-share-mount-into-docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
