You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: