When I get this error in WSL, it’s usually when Docker Desktop is not running on Windows, or the WSL integration is disabled.
Please make sure that the WSL integration is enabled for your default and any additional Linux distros: