Using Dev Containers with a Remote Docker Context (SSH), How to handle local mount paths? #718
Replies: 5 comments 2 replies
-
|
U can try create a log that activates/pull/commit in your remote with the
ssh from your local machine then adjust the tunnel.
…On Thu, Mar 12, 2026, 12:16 AM bhoobalan55-lang ***@***.***> wrote:
I'm trying to use the "Dev Containers" extension in VS Code, but my Docker
engine is running on a remote server accessible via an SSH context.
I can connect to the remote host fine, but when I try to "Reopen in
Container," I run into issues with workspace mounting. Since the source
code is on my local machine but the Docker engine is remote, the standard
bind mounts fail because the engine looks for the path on the remote
server's filesystem.
What is the proper architectural way to handle this? Do I need to sync the
files manually, or does the Dev Container spec have a built-in way to
handle "Local-to-Remote" source mapping?
—
Reply to this email directly, view it on GitHub
<#718>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BUTGOGSDW6FWA2ORODOEKHT4QJI3JAVCNFSM6AAAAACWPID72KVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZZGYZDQMJYGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Try gitlense/launchpad/gitkraken
On Thu, Mar 12, 2026, 1:39 AM Andrew Middleton <
***@***.***> wrote:
… U can try create a log that activates/pull/commit in your remote with the
ssh from your local machine then adjust the tunnel.
On Thu, Mar 12, 2026, 12:16 AM bhoobalan55-lang ***@***.***>
wrote:
> I'm trying to use the "Dev Containers" extension in VS Code, but my
> Docker engine is running on a remote server accessible via an SSH context.
>
> I can connect to the remote host fine, but when I try to "Reopen in
> Container," I run into issues with workspace mounting. Since the source
> code is on my local machine but the Docker engine is remote, the standard
> bind mounts fail because the engine looks for the path on the remote
> server's filesystem.
>
> What is the proper architectural way to handle this? Do I need to sync
> the files manually, or does the Dev Container spec have a built-in way to
> handle "Local-to-Remote" source mapping?
>
> —
> Reply to this email directly, view it on GitHub
> <#718>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BUTGOGSDW6FWA2ORODOEKHT4QJI3JAVCNFSM6AAAAACWPID72KVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZZGYZDQMJYGM>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
|
When you use a remote Docker Context, the devcontainer.json mount instructions are sent to the remote Daemon. By default, a bind mount like -v /home/user/project:/workspace tells the remote engine to look for that folder on the server and not on our local desktop so it expects the source code to exist where docker is running. My recommended solution for this is : Instead of useing a remote docker context , use VS codes remote SSH extension to connect to the remote server and then use Dev containers there. Else setup file sync to keep all you local files synchronized with a directory on the remote server and use bind mounts to that remote path. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use the "Dev Containers" extension in VS Code, but my Docker engine is running on a remote server accessible via an SSH context.
I can connect to the remote host fine, but when I try to "Reopen in Container," I run into issues with workspace mounting. Since the source code is on my local machine but the Docker engine is remote, the standard bind mounts fail because the engine looks for the path on the remote server's filesystem.
What is the proper architectural way to handle this? Do I need to sync the files manually, or does the Dev Container spec have a built-in way to handle "Local-to-Remote" source mapping?
Beta Was this translation helpful? Give feedback.
All reactions