Skip to content

Terminals via Docker containers #190

Closed

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.

Activity

  1. sr229 commented on Mar 11, 2019

    @sr229
    Contributor

    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.

  2. ezrizhu commented on Mar 11, 2019

    @ezrizhu
    Contributor

    This should be opt in.
    I agree, some people already run it in a docker container,

  3. jeasonstudio commented on Mar 11, 2019

    @jeasonstudio
    Contributor

    You mean add service orchestration officially?

  4. jeasonstudio commented on Mar 11, 2019

    @jeasonstudio
    Contributor
  5. RichardMcSorley commented on Apr 3, 2019

    @RichardMcSorley
    Contributor

    I would recommend to send this as a feature request to VSCode team too. Otherwise possibly an extension could do this 🤔 maybe

  6. sr229 commented on Apr 4, 2019

    @sr229
    Contributor

    @RichardMcSorley we can do a VSCode extension instead.

  7. kylecarbs commented on Apr 24, 2019

    @kylecarbs
    Member

    We have something in the works for this. Closing for now 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSome improvement that isn't a feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions