Open cbckly opened 4 months ago
Same problem here. There are so many people having the same problem, many claim one of the solutions work, but nope, they don't (anymore?).
I found the issue was with the new data-root
folder's permissions.
The daemon service attempts to set permissions to your new data-root folder, but there must be a bug in this process:
[2024-06-24T19:38:13.692148100Z][WindowsContainersController][I] data-root key found in options, applying permissions rules on D:\docker\data-root
[2024-06-24T19:38:13.696165400Z][WindowsContainersController][W] D:\docker\data-root: Attempted to perform an unauthorized operation.
[2024-06-24T19:38:13.696717400Z][WindowsContainersController][W] D:\docker\data-root: Access to the path 'D:\docker\data-root' is denied.
[2024-06-24T19:38:13.696717400Z][WindowsContainersController][W] D:\docker\data-root: Access to the path 'D:\docker\data-root' is denied.
This ends up corrupting the folder permissions, so further down the line,
[2024-06-24T19:38:13.873601000Z][WindowsDaemon][E] fatal: open D:\docker\data-root\panic.log: Access is denied.
The Fix
When setting the permissions to Exactly Match C:\ProgramData\Docker
the service did not apply permissions:
[2024-06-24T19:40:21.084984200Z][WindowsContainersController][I] data-root key found in options, applying permissions rules on D:\docker\data-root
And the daemon starts successfully.
Extra Notes
My data-root folder was empty - I did not attempt to migrate anything from C:\ProgramData\Docker
.
I manually modified my daemon-windows.json
in my User Home directory while Docker Desktop was Shut Off.
I used https://github.com/moby/docker-ci-zap to delete my C:\ProgramData\Docker folder before attempting to start Docker Desktop.
Exact Permissions were like:
Good luck to anyone reading this post !
Description
Have a need for Windows Containers under Windows 10. Can't use C drive, must use D drive.
Can install and start Docker Desktop, switch to Windows Containers, and watched C drive fill up after running a few dockers.
Quit Docker Desktop with the tray icon, edited daemon.json to add "data-root", escaped the slashes, made sure new path existed, and relaunched Docker Desktop. It fails to start, I believe it just times out after 30s.
If I launch dockerd like this, it starts error free:
"C:\Program Files\Docker\Docker\resources\dockerd.exe" -G docker-users --config-file c:\programdata\docker\config\daemon.json
But Desktop doesn't work so well doing this.... And running docker commands seems to expect a different pipe but didn't write down what it said.
I've tried setting data-root with existing installs, new installs, half dozen times trying to find the nuance and nothing worked.
Googling showed most people just set a symlink and didn't bother with data-root. Resisted this at first since it was configurable, but after hours of wasted effort, decided it was best as Docker would still create the daemon.json file on C and a bunch of other stuff anyways. Uninstalled Docker Desktop, set the symlink:
Installed Docker Desktop, and to my utter dismay received this error message:
"Something went wrong. Starting Windows containers: status code not ok but 500. Path contains symlink: C:\ProgramData\Docker"
I can't tell if it's stopping BECAUSE of the symlink, or it's just info, but man, I wasn't expecting this to fail either. It let me create a file in C:\ProgramData\Docker okay, but otherwise there is nothing there.
Deleted the symlink and launched it again and it started up fine. Right back on C drive...
Windows Containers can not work anywhere but drive C.
(Out of pure desperation I robocopy'ed the files to D: and put the symlink in place, as expected, that also failed with the "Path contains symlink" error)
Reproduce
1: mklink /j "C:\ProgramData\Docker" "D:\Docker\ProgramData-Windows" 2: Install Docker Desktop
Expected behavior
Windows Container data should go where I designate it. Not where you want it. I couldn't even choose where Desktop installed to...
docker version
docker info
Diagnostics ID
F64681A5-50B9-4EC7-A70F-76EC829A85DD/20240224201239
Additional Info
No response