On Windows systems, if you receive a permission error when trying to run Docker commands inside a Windows container, it may be because the user account running the Docker command doesn’t have the necessary permissions to access the Docker daemon.
To resolve this issue, you can either:
- Run the Docker command as an administrator by right-clicking on the Command Prompt or PowerShell and selecting “Run as administrator”.
- Add the user account to the Docker group on the host system. You can do this by going to the “Local Users and Groups” section in the Computer Management console and adding the user account to the “DockerDesktopUsers” group.
- Add the user account to the Hyper-V Administrator group on the host system. You can do this by going to the “Local Users and Groups” section in the Computer Management console and adding the user account to the “Hyper-V Administrator” group.
Note that these changes will require a logout/login or a reboot of the host system for the changes to take effect.
Thank you and Regards,
Tharanga Chandrasekara