-
Notifications
You must be signed in to change notification settings - Fork 300
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
Investigate: Reducing reliance on runArgs
for common scenarios: mount points, environment variables
#1201
Comments
@chrmarti FYI - After looking into the best way to enable HTTPS support for .NET Core applications, I've updated the vscode-remote-try-dotnetcore sample. It is now a pretty textbook example of where "runArgs": [
"-u", "vscode",
"-e", "ASPNETCORE_Kestrel__Endpoints__Http__Url=http://*:5000",
"-e", "ASPNETCORE_Kestrel__Endpoints__Https__Url=https://*:5001",
"-v", "${env:HOME}${env:USERPROFILE}/.aspnet/https:/home/vscode/.aspnet/https",
"-e", "ASPNETCORE_Kestrel__Certificates__Default__Password=SecurePwdGoesHere",
"-e", "ASPNETCORE_Kestrel__Certificates__Default__Path=/home/vscode/.aspnet/https/aspnetapp.pfx"
] The https://github.com/microsoft/vscode-remote-try-dotnetcore README explains what these things do. Theoretically you could bake the env vars into the Docker image, but leaving them in devcontainer.json allows you to enable/disable HTTPS and change port mappings as appropriate. I'd expect this to be something people will pretty commonly want to do given .NET Core's out of box self-signed HTTPS certs. |
To pick up another discussion: We could have two properties: |
@chrmarti That's an excellent idea. In some ways, I almost wonder if it should be flipped.
|
Or Is there a reason to prefer One limitation for the server's environment is that all connected windows will need to reload because we need to restart the agent. (We could look into keeping the old agent and extension hosts around for windows that aren't reloaded yet, but I'm not sure that simply works.) |
@chrmarti Hmmm. Effectively wouldn't a rebuild would have the same effect, but would be slower? |
@Chuxel Correct, with 'agent' I mean the VS Code server process, the container can keep running. The limitation might be that if you have multiple windows open on the same container, you need to reload all of them - not just one - for the change to apply. |
@chrmarti Yep, but effectively a rebuild would get it to kick in as well, which is why it seems like a better default. It would work in both cases rather than just a full rebuild. On a related note, on the VSO side, I know they're looking at adding a "restart server" option to allow this kind of thing to kick in. Perhaps we should consider something similar for the remote extensions for the reason you mention. SSH has "Kill" which effectively gets you along the same lines, but containers and WSL don't have a similar concept. |
@chrmarti Okay, talking with the VSO folks, here's a proposal:
Which would take the container's PATH env var and add something to it. This wouldn't work for "-e", but would in this case. What do you think? Even if we don't add the second part right away, the VSO folks might to solve some issues. |
Copying @Chuxel 's notes from a wider discussion here:
User then has the same pattern.
|
Note that the resolver API allows the resolver to return environment variables in the ResolverResult. These will apply to the remote extension host even if there is another remote extension host with older environment variables still running on that same container. This is contrary (i.e., better) to what I previously thought where my assumption was that all windows (and thereby remote extension hosts) need to be restarted for a change to "remoteEnv" to apply. |
No description provided.
The text was updated successfully, but these errors were encountered: