dockware / docs

1 stars 8 forks source link

Bind mounting #3

Open raphaelboos opened 3 years ago

raphaelboos commented 3 years ago

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.

1) 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 2) 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. 3) 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 4) 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. 5) Move the content around - Chaining commands on windows with && does not work. 6) 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.

`

%kernel.project_dir%/config/jwt/private.pem %env(string:default:jwt_private_key_passphrase_default:JWT_PRIVATE_KEY_PASSPHRASE)% false

%kernel.project_dir%/config/jwt/public.pem false

` 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.

boxblinkracer commented 3 years ago

Hi

thanks a lot I've just linked the docs to this page, until we have some time to integrate it in the docs