Container File Permissions in Windows Container Container File Permissions in Windows Container docker docker

Container File Permissions in Windows Container


Unclear why, but cacls doesn't seem to be working when run as part of building the container. Switched to using icacls, and was able to grant the IIS_USRS permissions on the folder.

Line added to dockerfile:

RUN icacls 'C:\inetpub\wwwroot\App_Data' /grant 'IIS_IUSRS:(F)'


I can't comment as I don't have enough reputation, but if the answer by @Darendal doesn't work (which it did not for me), then try this syntax

RUN icacls C:\inetpub\wwwroot\App_Data /grant "BUILTIN\IIS_IUSRS:(OI)(CI)F" /t


My dockerfile did not accepted any of the other answers. Below is one more alernative.

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8SHELL ["powershell"] RUN & ICACLS "'C:\inetpub\wwwroot\App_Data'  /grant 'IIS APPPOOL\DefaultAppPool:(OI)(CI)F' /T"