Question

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 ?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top