Description
The current bind mounting explanation (https://docs.dockware.io/tips-and-tricks/how-to-use-bind-mounting) is not working well for windows users.
The description is made for Unix and does not work for windows users. I am no expert in both - this is my view as user of the manual.
- Please add an instruction to precheck for enabled longpath names. Otherwise copying will fail with "paths not found". Instead of letting users run into this problem - please make a hint before.
https://answers.microsoft.com/de-de/windows/forum/all/aufhebung-der-dateinamenl%C3%A4nge-unter-windows/70811d50-e98c-4825-af28-fad79d3eca63 - Please add an instruction to start cmd/shell on host with admin permissions. Otherwise running commands to copy files from container to host will fail on symlinks.
- Copying the content - Syntax of commands won't work for windows users e.g on the windows power shell (or specifiy the command line tool to work with on windows).
docker cp shop:/var/www/html/. ./src - the ending dot in the source does not work, an error occurs.
docker cp shop:/var/www/html/ ./src - this one works - In the rest of the documentation in most cases you specifiy where to run the command - on the host or in the container.
You didn't specify this in the bind mount docs. - Move the content around - Chaining commands on windows with && does not work.
- The next problem you run into after completing the sources - are permissions for .pem files.
You get a symfony exception "User Notice: Key file "file:///var/www/html/config/jwt/public.pem" permissions are not correct, recommend changing to 600 or 660 instead of 777". For unix users, there is a detailed explanation how to set permissions - but not for windows users. Windows permissions for files on the host are interpreted different in the container. I played around with permissions - it is impossible to set permissions to the required 600 or 660. The best result was 666.
We found a workaround for this for DEV environments.
Change the config/services/default.xml on the host and turn off symfony permission checks.
Change your XML as follows - the important part is the keyPermissionsCheck and the empty argument for the public key.
<service class="League\OAuth2\Server\CryptKey" id="shopware.private_key"> <argument>%kernel.project_dir%/config/jwt/private.pem</argument> <argument>%env(string:default:jwt_private_key_passphrase_default:JWT_PRIVATE_KEY_PASSPHRASE)%</argument> <argument key="$keyPermissionsCheck">false</argument> </service> <service class="League\OAuth2\Server\CryptKey" id="shopware.public_key"> <argument>%kernel.project_dir%/config/jwt/public.pem</argument> <argument></argument> <argument key="$keyPermissionsCheck">false</argument> </service>
7) Bind mounting the sources to a Windows Host System - restricts you in many ways
a) bin/console commands like plugin:activate oder plugin:install -activate will not work as they run unix commands like chmod - there is no equivalent on a windows host. For example you can create a theme but never activate it.
b) The admin backend has the same limitations.