
Description
From my point of view, having the terminals access the host machine is a big downside when it comes to security and tooling.
Adding docker (or even Kubernetes) support would help making terminals and maybe also debugging a lot nicer. For each project there could be a settings file which determines which docker image to run in a terminal.
Quick example to make this more understandable:
Imagine opening a NodeJS project, with the following file added:
.code-server/settings.json
{
"terminal.dockerImage": "node:10-slim"
}
Now, launching a terminal would automatically spin up a new docker container, attaching to a pseudo-terminal, and bind-mounting the current project directory into it.
For bare metal installations, this would work by running code-server with a user that has permissions to access the docker socket at /var/run/docker.sock
. For the code-server docker image, you would have to bind mount the socket to the container, and access it from there: docker run -v /var/run/docker.sock:/var/run/docker.sock [...] codercom/code-server
It would also be nice to have a seperate command/modal called "New terminal" which prompts you to enter a docker image name, and saves the most frequently used ones.