

- #LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP INSTALL#
- #LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP UPDATE#
- #LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP CODE#

If you already have a devcontainer.json file in a GitHub repository that references an image or Dockerfile, the command will automatically use a named volume instead of a bind mount - which also works with remote hosts. command in the Command Palette ( F1) uses this same technique. In fact, the Remote-Containers: Clone Repository in Container Volume. Here is a basic devcontainer.json example of this setup:
#LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP CODE#
The first is to create your remote dev container first, and then clone your source code into a named volume since this does not require you to have direct access to the filesystem on the remote host.
#LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP UPDATE#
We'll cover more on information on how you can connect using settings and environment variables or Docker contexts later in this section.įor devcontainer.json, there is one additional step: You'll need to update any configured (or auto-configured) bind mounts so they no longer point to the local filesystem. See the article on using SSH Keys with Git for details on configuring the agent and adding your key.Īt this point, you can attach to containers on the remote host. Setting up VS Code to attach to a container on a remote Docker host can be as easy as setting the Docker extension docker.host property in settings.json and restarting VS Code (or reloading the window).įor example: "docker.host" : SSH requires a supported SSH client, that you have key based authentication configured for the remote host, and that the key is imported into your local SSH agent.

This approach is also useful if you are looking to attach to already running containers on this remote server. While using the Remote - SSH extension is easier and doesn't require the Docker CLI to even be installed locally, this model can be useful for situations where you already have a host you are connecting to from the command line. This model only requires that a Docker Engine be running on a remote host that your local Docker CLI can connect to. You can learn more about the Remote - SSH extension in its documentation. The rest of the Remote - Containers quick start applies as-is.
#LOCAL AND REMOTE FOLDERS ON FOLDER SYNC APP INSTALL#
You do not need to install Docker locally.
