Terminals via Docker containers
See original GitHub issueFrom 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: <kbd>.code-server/settings.json</kbd>
{
    "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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8 (7 by maintainers)

 Top Related Medium Post
Top Related Medium Post Top Related StackOverflow Question
Top Related StackOverflow Question
This should be opt in. Some people won’t be using this feature since some of them might want access to the same environment the server runs, but overall, this is a nice feature since it allows more isolation.
We have something in the works for this. Closing for now 👀