Docker for desktop gives "Access Denied" Error

488 Views Asked by At

I have installed "Docker for Desktop" in Windows Server 2022

I have switched docker daemon to Windows containers.

Then I am running below command:

docker run -it mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd.exe

Above command opens a interactive command prompt, where I run below command to create a file.

echo "Hello World!" > Hello.txt

But the above command gives error as "Access Denied" in the command prompt.

echo %USERNAME%

Above command gives the username as "ContainerUser". So how to give the Container user an admin rights to create a file/directory? Is there any settings to be done in the docker side?

I tried to look for what is ContainerUser, upon which I understood it is the user from the nano server image which I am running, but unable to find any proper solution for the same. Using Windows Server 2022 VM -> Nested Virtualization and Hyper V enabled

0

There are 0 best solutions below