Docker "unable to calculate image disk size"
Asked Answered
C

5

13

When running docker desktop, it starts for 2 seconds and then closes.

I have tried reinstalling and changing the configuartion but nothing has worked so far.

Claudicant answered 14/11, 2022 at 12:35 Comment(0)
B
12

I just had the same error today. I cannot be sure it is the same problem that you have so you must check first. I was getting the message "unable to calculate the disk image size" in the UI and not being able to execute any docker command to prune it (https://docs.docker.com/config/pruning/) since the daemon was down. I also updated docker to the latest version and the error was still there. I am supposing you are using Docker Desktop for Windows over WSL 2.

The first step was to execute the self diagnostic tool (https://docs.docker.com/desktop/troubleshoot/overview/#self-diagnose-tool)

C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe check

Just to find out the following error message (and a few others that can be related, so I ignored them): "WSL Distribution docker-desktop is missing"

Distribution error

So, I checked the WSL list using the wsl --list --verbose command and the docker-desktop distribution was in the "Uninstalling" state.

Following the advice here (even it is not for the same error) https://github.com/docker/for-win/issues/6971#issuecomment-636358053 which ensures it will be recreated, I executed wsl --unregister docker-desktop and started the docker engine again and everything started without errors.

wsl and docker

I am not sure what caused it, but it certainly wasn't disk space.

Buber answered 6/12, 2022 at 0:36 Comment(0)
E
0

In my case what helped was: uninstalling Docker, unregistering both Docker containers from wsl, removing Docker and Docker Desktop from %APPDATA% and reinstalling Docker.

Elegancy answered 17/8, 2023 at 13:13 Comment(0)
D
0

I experienced a similar problem and here is what I did.

First I ran the following command

$ wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

Then I just unregister all distros like that

wsl --unregister docker-destop
wsl --unregister docker-destop-data
wsl --unregister ubuntu

And again installed ubuntu

wsl --install ubuntu

After all this, just launched the docker desktop. And it started

Den answered 22/8, 2023 at 18:23 Comment(0)
H
0

In my case, I pruned all the unused containers, images, and volumes, as mentioned in the other comments. Additionally, I performed a "reset to factory defaults" (it's in Azure Desktop). Note that all settings and data will be removed. After these steps, the problem was resolved.

Hyoscyamine answered 1/5 at 11:16 Comment(0)
B
-4

docker system prune
this worked for me

Begot answered 14/11, 2022 at 12:36 Comment(5)
Have already tried to prune but unfortunately did not work for me.Claudicant
docker system prune -aBegot
This gave another error "error during connect: This error may indicate that the docker daemon is not running." Could not find an answer to this problem aswell so im kinda stuck in a loop right now.Claudicant
open cmd as admin and run: "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemonBegot
If Docker Desktop isn't starting up, you won't be able to run any docker commands.Sophistry

© 2022 - 2024 — McMap. All rights reserved.