-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev-Container support #13372
Dev-Container support #13372
Conversation
7e8921d
to
eb8312f
Compare
54c5a43
to
3f4f058
Compare
packages/dev-container/src/electron-node/remote-container-connection-provider.ts
Show resolved
Hide resolved
packages/dev-container/src/electron-browser/container-connection-contribution.ts
Outdated
Show resolved
Hide resolved
...tainer/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-node/remote-container-connection-provider.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-node/remote-container-connection-provider.ts
Outdated
Show resolved
Hide resolved
packages/core/src/electron-browser/window/electron-window-service.ts
Outdated
Show resolved
Hide resolved
@msujew : Once you give your approval, we will do another test, does this work for you? |
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
…on files Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
56ceb78
to
4a18a6f
Compare
@JonasHelming Since Mark is on vacation for the rest of the Month, feel free to test it and give feedback if you find the time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @jonah-iden! This is great work and already works pretty nicely.
My biggest wish would be to show the output of the docker container, to help diagnosing issues. Currently it is very hard to debug situations where the container doesn't start for some reasons, which may happen quite easily since we don't support the full devcontainer format yet.
Aside from that I have a security related question: Afais we don't protect the exposed port of the Theia backend running in the container from the outside world, or did I miss that?
If we don't, I suggest to bind at least the Theia backend port only to the local IP address by default to avoid having it exposed to the entire network.
Other than that I only have a few minor nitpicks inline.
Thanks again for your great work on this feature! This is truly a game-changer, and I'm eager to see it evolved incrementally to support more and more properties of the devcontainer format.
|
||
The `@theia/dev-container` extension provides functionality to create, start and connect to development containers similiar to the | ||
[vscode Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to document which properties of the devcontainer format are supported at the moment or link to an issue that lists the unsupported ones.
packages/dev-container/src/electron-browser/container-connection-contribution.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-browser/dev-container-frontend-module.ts
Show resolved
Hide resolved
packages/dev-container/src/electron-node/remote-container-connection-provider.ts
Outdated
Show resolved
Hide resolved
...tainer/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts
Show resolved
Hide resolved
...tainer/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-common/remote-container-connection-provider.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-node/dev-container-file-service.ts
Outdated
Show resolved
Hide resolved
packages/dev-container/src/electron-node/remote-container-connection-provider.ts
Show resolved
Hide resolved
Thanks for the review! I'll try to add showing the output today |
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
@planger added a for now very basic output display. There is some messages not looking super nice but that can be improved later on |
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
@jonah-iden When this is ready for re-reviewe, please just trigger Philips review again |
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the additions @jonah-iden! This looks great and I think it should be good to go as a first version of this excellent feature.
@jonah-iden for this patch, are ENV variables like ${localWorkspaceFolder} and ${localEnv:HOME} suppose to work for mounting? Because it keeps saying add absolute path https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount |
@hsnoil no sorry, variables in the devcontainer.json are not yet implemented for dev-containers. I took a small look at it. Seems like implementing this would require a refactor or similar of the VaraibleResolverService so that it would be somehow available in the backend |
What it does
This implements a first version of the Dev-Container Support vscode offers for Theia. This can later also be used to forward arbritrary ports at container runtime
The devcontainer.json format offers alot of configuration option of which currently only a certain few are implemented.
Implemented properties are:
image
dockerfile
/build.dockerfile
(dockerfile support still needs some more testing and work regarding its options)build.args
which are just passed to docker as isforwardPorts
mounts
The communication with the theia backend inside the container is done through a docker exec instance to the ´dev-conatiner-server.ts´ which forwads all communcation to stdio.
Support for having multiple devcontainer files is also added
I would love some feedback on this, especially what missing features would be most important to make it most useful.
How to test
You need docker installed and started on your machine
.devcontainer
folder at the rootdevcontainer.json
and neccessary resources for ithere is an example file using a image wich is automaticly pulled by docker
or here is a dockerfile with its respective devcontainer.json file for testing dockerfile support:
devcontainer.json
Dockerfile.txt
Dev Containers: Reopen in Container
Follow-ups
Things not implemented yet which vscodes supports:
dockerconfig.json
Review checklist
Reminder for reviewers