1

I am running .NET Aspire 9.3 inside Visual Studio 2022 v2 on Windows 11 with WSL (Ubuntu) and Docker installed. However, Aspire defaults to using Docker Desktop, and I want it to use WSL's Docker instance instead.

My Setup:

  • Windows 10 with WSL 2
  • Ubuntu (WSL) with Docker installed
  • Visual Studio 2022 v2
  • .NET Aspire 9.3
  • Docker Desktop also installed (but I want to use WSL's Docker)

Issue:

When I run my Aspire project in Visual Studio, I get the warning:

warn: Aspire.Hosting.Dcp.DcpHost[0]
      Container runtime 'docker' could not be found.

I suspect Aspire is looking for Docker in Windows rather than WSL's Ubuntu instance.

What I've Tried:

Disabled Docker Desktop to force WSL usage. Aspire still fails to detect Docker.

Question:

How can I configure .NET Aspire to use Docker inside WSL (Ubuntu) instead of Docker Desktop when running within Visual Studio?

1
  • Can you run other projects in WSL Docker ? Another suggestion would be to make sure that your environment variable is set DOTNET_ASPIRE_CONTAINER_RUNTIME -> docker Commented Sep 11 at 12:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.