Open AceHack opened 5 months ago
FYI, the reason I'm doing this is because I'm trying to run Visual Studio on my M2 Mac Studio on Windows ARM VM in Parallels and use Docker Desktop host on my Mac because I can't install docker desktop on Windows because I can't enable nested virtualization on Apple Silicon and therefore no Hyper-V and therefore no Docker Desktop on Windows ARM VM.
If there is a workaround to get this working, I'm happy to try another way.
You can see I tried vscode on my Mac directly and it seems while I can run things, debugging does not appear to be working. https://github.com/dotnet/aspire/issues/1651
Not sure if we can get to this investigation in the near term to support Docker running on a remote host. I think that VS Code once it is supported will probably be the better solution for this.
Any news on this?
I run docker directly on wsl2 without using docker desktop and can't use aspire for this...
I see in the source that aspire look for docker desktop executable instead of referencing DOCKER_HOST environment variable as other libraries do (ex. testcontainer)
We do depend on Docker CLI (or Podman CLI) being available on the path, but it doesn't have to specifically be Docker Desktop for Windows. Docker publishes builds of the Docker binaries or you can use a package manager such as winget or Chocolatey to install the Docker CLI.
Thanks for the hint, il give it a try. Just curious. there are any advantages or necessities to depend on the docker/podman cli instead of using the DOCKER_HOST solution?
i installed docker cli with winget and I can connect to the remote docker engine (my setup is docker engine running on wsl2 without docker desktop)
but aspire is still not working:
Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
Aspire.Hosting.DistributedApplicationException: Container runtime 'docker' could not be found. The error from the container runtime check was: exec: "docker": executable file not found in %PATH%.
See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes.
at Aspire.Hosting.Dcp.DcpDependencyCheck.EnsureDcpContainerRuntime(DcpInfo dcpInfo) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 190
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 99
at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 115
at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHostService.cs:line 67
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
but the docker executable is in %PATH%.
pwsh echo $Env:PATH C:\Program Files\PowerShell\7;C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot\bin;C:\Program Files\Python311\Scripts\;C:\Program Files\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\WireGuard\;C:\Program Files\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\PowerShell\7\;C:\Users\giamm\AppData\Local\Microsoft\WindowsApps;C:\Users\giamm\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\giamm\AppData\Local\Programs\Azure Data Studio\bin;C:\Users\giamm.dotnet\tools;C:\Users\giamm\AppData\Local\Programs\oh-my-posh\bin;C:\Users\giamm\AppData\Roaming\npm;C:\Users\giamm\AppData\Local\Microsoft\WinGet\Packages\Docker.DockerCLI_Microsoft.Winget.Source_8wekyb3d8bbwe\docker;
Thanks for the hint, il give it a try. Just curious. there are any advantages or necessities to depend on the docker/podman cli instead of using the DOCKER_HOST solution?
Mostly to avoid a lot of headaches with authentication/access to remote endpoints; the endpoint could be a named pipe, a unix domain socket, http(s), or even SSH, plus it (hopefully) is protected with certificates or other credentials, which would also need to be configured. Since Docker (or Podman) have already abstracted away all those connection details for us, it ends up easier to depend on the CLI (plus it has the added bonus of guaranteeing that any commands we run, the user can run the same command from the CLI and get the same results).
As for not finding docker
on the path, first troubleshooting step I'd do would be to restart any VS/VSCode/shell instances that were running before you installed the CLI, since they wouldn't be able to see any changes to environment variables made after they were launched.
I get the same error as giammin above related to docker: Aspire.Hosting.DistributedApplicationException: Container runtime 'docker' could not be found. The error from the container runtime check was: exec: "docker": executable file not found in %PATH%.
Tried restart everything but still same error. When typing docker
in a normal shell it works, so it's in my PATH. Feels like Rider, or more specifically something related to just Aspire gets the wrong PATH.
in my case after updating all the aspire requirements and a reboot the issue disappeared.
My docker host is set to
DOCKER_HOST=tcp://10.211.55.2:12675
When I try the starter app it's unable to connect to redis because it's expecting it to be on localhost I think but it's not, it's on the custom host.