我在Windows主机上使用Windows / iis,并尝试通过docker-compose挂载卷。我的问题是挂载文件的所有权。 IIS无法执行任何php文件(IIS中的PHP可以正常工作,如果文件是在容器中创建的,我可以通过浏览器执行phpinfo)。 docker-compose安装卷时可以更改所有权吗?
我的docker-compose.yml:
version: '3.6'
services:
iis:
build: ./docker/iis
ports:
- "8080:80"
environment:
- COMPOSE_CONVERT_WINDOWS_PATHS=1
- COMPOSE_FORCE_WINDOWS_HOST=1
volumes:
- type: bind
source: .\
target: C:\inetpub\wwwroot\
volume:
nocopy: true
当前所有权:
PS C:\inetpub\wwwroot> get-acl phpinfo.php | fl
Path : Microsoft.PowerShell.Core\FileSystem::C:\inetpub\wwwroot\phpinfo.php
Owner : O:S-1-5-21-564662737-1608546433-1253539930-1001
Group : G:S-1-5-21-564662737-1608546433-1253539930-513
Access : BUILTIN\Administrators Allow FullControl
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Users Allow ReadAndExecute, Synchronize
NT AUTHORITY\Authenticated Users Allow Modify, Synchronize
Audit :
Sddl : O:S-1-5-21-564662737-1608546433-1253539930-1001G:S-1-5-21-564662737-1608546433-1253539930-513D:AI(A;ID;FA;;;BA)(A;ID;FA;;;SY)(A;ID;0x1200a9;;;BU)(A;ID;0x1301bf;;;AU)