Native AppHost API for running Docker containers on Remote Machines via SSH #18577
Replies: 2 comments 2 replies
-
|
So there is no animo for this? |
Beta Was this translation helpful? Give feedback.
-
|
It's an interesting idea, but we'd have to balance any API against the need to support not just Docker, but Podman as well. We'd also need to take into account how this might work in a distributed team or CI environment. This is the sort of thing that often needs to be treated as per-developer or per-machine configuration and having a specific config checked in only makes sense for a single maintainer project. That's not meant to imply that there's not value in solving problems for single maintainer projects, but we have to reconcile a potential API against all the different environments it could end up used in. We're also looking at adding support for more runtimes (wslc for Windows and Apple container for macOS in the future), neither of which have support for a remote context and several container features such as bind mounts work unexpectedly for many users in a remote environment. It's not that there's no interest in this, but we're primarily focused on local dev scenarios and would generally encourage running the entire workload on the remote machine if possible rather than trying to split between local and remote. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The Motivation
As distributed applications grow, running all dependencies locally quickly consumes a developer's machine resources. While developers have access to powerful remote dev servers, securely pushing Aspire-managed containers to these machines is currently difficult.
Furthermore, there is a strong security benefit to this approach. Running untrusted or heavy third-party container resources on a remote machine acts as an effective sandbox, isolating the developer's local workstation from potential resource exhaustion, malware, or network vulnerabilities hidden within container images.
Currently, achieving this requires global environment variables like DOCKER_HOST=ssh://... or custom SSH.Net scripts. This often breaks Aspire's seamless endpoint management, resulting in broken links on the Aspire Dashboard and proxy conflicts.
The Proposed Solution
I propose introducing a new AppHost API that models a Remote Machine as a Resource. You can then pass this remote machine resource to any container resource, instructing Aspire to spin up the container remotely via SSH, while managing the tunnels, dashboards, and logs locally.
By treating the remote machine as an explicitly defined resource, the Aspire AppHost can handle the heavy lifting under the hood—such as automatically establishing transparent SSH tunnels for the container's endpoints and streaming remote docker logs directly back into the local Aspire Dashboard.
Beta Was this translation helpful? Give feedback.
All reactions