Docker Community Forums

Share and learn in the Docker community.

Magento2 | Docker files permissions on Windows volume

docker

(Remiherrero) #1

Hi all,

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 :

Infos :
Windows : Win 10 Pro 17134.165
Docker fo windows : version Version 18.03.1-ce-win65 (17513)
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 ?

Thanks in advance.!