1

I'm trying to set up correctly a magento2 project with Docker on Windows 10 and I'm mounting 2 volumes (one with magento2 files and one to save db files). When I'm trying to get in the admin dashboard in Magento2, there are some bugs because files are not loaded correctly.

What I'm doing : Run docker-compose up. I have to uncheck docker shared drives before to run docker-compose up else i'm getting an "mount volume already exists" error. I'm getting issue also with bin/magento cache:flush or bin/magento setup:upgrade : Magento can't delete some files (No such file or directory) I'm getting issue also with the front : the application can't find ou modify Interceptor.php.

Please note as I'm on Windows and mounting a Windows volume, so change chmod or owner won't fix the issue. Directory and files are mounted with chmod 755 as root:root and you can't change this (https://docs.docker.com/docker-for-windows/faqs/#volumes).

After searchs; there is something locking files as you can check in the Windows computer management : Capture

Infos :
Windows : Win 10 Pro 17134.165
Magento : 2.2.5
User apache : www-data
User php-fpm : root

I have already done (and the issue is still there) : run php as root (with php-fpm) Settings Administrators Hyper-V and docker-users on my local machine (https://github.com/docker/for-win/issues/868)

Can you please tell what I'm doing wrong and why I'm still getting this issue ?

0

I have the same problem and I found a solution:

1) Remove the "Magento 2" containers

2) Turn off the docker

3) Turn on the docker

4) Go to Settings > Shared Drives> Reset credentials> Select drives and click "apply"

5) Lift the "Magento 2" containers

6) Execute "php bin/magento setup:di:compile" and "php bin/magento setup:static-content:deploy -f"

That is, the problem appears when we have the docker started and the "Magento 2" containers are running. We have to remove the "Magento 2" containers before turning off the docker. I think it's a Docker bug

  • Hey Chen, thanks for your help. Made test with Docker 2.0.2 and files lock are deleted successfully instead of keep files in lock mode. I think it was a Docker bug and may be they did a fix for that. – Jakk64 Jan 22 at 11:28
  • Thanks Jakk64, I used Docker 2.0.2 and it worked like a charm! All fine. – Chen Hanhan Jan 28 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.