Skip to content
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

Support post VScode install hook #414

Open
2tony2 opened this issue Feb 7, 2024 · 1 comment
Open

Support post VScode install hook #414

2tony2 opened this issue Feb 7, 2024 · 1 comment

Comments

@2tony2
Copy link

2tony2 commented Feb 7, 2024

Context

Hey all. I was working with devcontainers in the following setting:

Let's say I'm trying to get SSO to work with an external browser in a dev container. This is tricky because most SSO applications (and a lot of other ones for that matter) tend to use "Any free TCP port available". On linux, the OS will resolve this to a random available port. I found a work around to make this work by restricting available port range with something like sysctl net.ipv4.ip_local_port_range: "60000 60100" and just port forward those.

Now, I've noticed setting this on the docker build really hampers VScode devcontainers. Specifcally, the installation of extensions becomes very slow. There seems to be a lot of dynamic port use in the background when VScode is initially setting up a server and extensions on the dev container.

It's possible to resolve this (and other use cases I presume) by having some sort of a post-VScode build hook. Right now, all of the hooks given in the devcontainer.json cannot wait for the full VScode initialization to be complete before running code. The workaround now is doing something like adding entries to .bashrc or .zshrc to introduce custom pre-shell hooks whenever opening a new shell post build.

I'd think it makes sense to have support for a post VScode initialization hook within devcontainer.json, but not sure about the feasbility of something like that.

@samruddhikhandale
Copy link
Member

Hello 👋

Looping in @chrmarti who has expertise on how VS Code initialization works and even if this request is doable/feasible.

to have support for a post VScode initialization hook within devcontainer.json

This sounds like an enhancement to the spec and a request for a new lifecycle hook. Hence, moving this to the spec repo.

@samruddhikhandale samruddhikhandale transferred this issue from devcontainers/cli Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants