Unable to build dmaster on Windows
wmortada opened this issue ยท 10 comments
It looks like civicrm-buildkit-docker doesn't work on Windows machines due to file permission issues.
I'm raising this ticket following a discussion in mattermost to alert others that may attempt to use Docker on Windows.
The main issue
I've got the container up and running but buildkit create dmaster
fails on a drush command. It gets most of the way through the installation. The files are there, the database is created. I can even see the drupal install screen in the browser but the installation doesn't complete.
The drupal installation fails at this step: drush vset --yes file_private_path /buildkit/app/private/dmaster/default
With the following error:
Command variable-set needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.
The drush command 'vset file_private_path /buildkit/app/private/dmaster/default' could not be executed.
If I log in to the docker container the /buildkit/build
directory and contents are owned by root
not buildkit
which seems odd. On my linux machine that directory and contents are owned by buildkit
which makes me think there is something wrong with permissions.
That folder is a filesystem mount from Windows. This means that it isn't possible to change the permissions e.g. with sudo chown -R buildkit:buildkit /buildkit/build
. This doesn't work because Windows is controlling the filesystem permissions.
This appears to be a limitation of Docker Desktop on Windows so I don't know if it is possible to fix this here. It may just be a question of letting people know that it doesn't work on Windows.
Thanks to @MikeyMJCO for helping to confirm this issue
Another issue
I've also found that the site is accessible at http://localhost:7979
rather than http://dmaster.localhost:7979
so something isn't working with the network.
buildkit create wpmaster
completes installation but I'm unable to view the site at http://wpmaster.localhost:7979
or http://localhost:7979
. I just get an 'unable to connect' to server message.
Environment
Windows 10
Docker Desktop for Windows v 19.03.1
I've confirmed on Docker Desktop 2.2.0.5 (43884). Engine version 19.03.8
I'm planning to test on WSL2 next week as it has much better permissions awareness afaik!
@MikeyMJCO says "It will work again on Windows with WSL/2 - but that's currently only on insider."
People should feel free to update this ticket if and when they can confirm that stuff has started working on Windows. Would be good to also update the readme at that time.
@MikeyMJCO is this the newsflash you were waiting for? https://devblogs.microsoft.com/commandline/wsl2-will-be-generally-available-in-windows-10-version-2004/
Kinda - already running 2004 now here (insider preview!) just need to get around to testing it :-)
I setup Docker on my Win10 workstation. I enable WSL based on this doc: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
Once my existing ubuntu wsl envu=iornment was converted and I set the default to WSL I followed this doc: https://docs.docker.com/docker-for-windows/wsl-tech-preview/
Running docker-compose
from the WSL cli I was able to build dmaster, wpmaster with the default settings
Yeah - I managed to retest as well this morning. Confirming the same successful results./
I'm using the generally available version of WSL 2 and Docker Desktop 2.3.0.3 (stable channel) and I can confirm the build succeeds, provided I install/run everything inside the WSL 2 instance.
Docker have provided good instructions here for enabling its WSL2 integration and upgrading an existing WSL installation to WSL2.
So this is now, fundamentally a documentation problem.
That's your favourite kind of problem isn't it, @MikeyMJCO ?!