if you get this error ‘dial unix /var/run/docker.sock: connect: permission denied‘ when you run docker command in WSL Ubuntu. From the exception you can tell it is a permission issue. For my case below are the steps to fix it.
Error when running docker-compose command: To resolve this error, I did update docker compose to the version v2.9.0.
When you tried startup WSL when it was stopped and you got an error message Logon failure: the user has not been granted the requested logon type at this computer. The solution is restart vmcompute service.
When you were running Docker in WSL2 and got this error message “Cannot connect to the Docker daemon at tcp://0.0.0.0:2375. Is the docker daemon running?” Instead, turn on “Expose daemon on tcp://localhost:2375 without TLS” option and use the DOCKER_HOST variable which considers security risk. The best option is enabled WSL Integration in Docker Desktop. i.e.…