-
Notifications
You must be signed in to change notification settings - Fork 234
Add devcontainer support for building in container #993
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
Conversation
This is neat! So I see this primarily being useful for running tests, right? |
You can run tests as well, my personal experience though is that for longer test suites that take several minutes like PSSA is that Invoke-Pester can make the remote connection to the container hang. |
Sorry, for the many, intermittent pushes, I am done now and fully rebuilt the container just to double check it is still working. Not sure about the current build failures though |
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.
Sorry this took so long... I think we should use the new SDK image that has PowerShell installed and also use the Preview extension instead.
.devcontainer/Dockerfile
Outdated
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1.602 |
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.
If you target the new .NET Core 3.0+ SDK container it contains PowerShell and you won't need to install it.
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.
I agree but before that the main build needs to move .net core 3 (I vaguely remember the build to not work with it, but maybe that was an issue with one of the previews)
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.
Gooood point. Looks like that is the case: #1095
Maybe we can try to get that figured out first before this goes in? My team put in work to get PowerShell inside the SDK container - I'd love to leverage that if possible as a form of dogfooding it.
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.
@rjmholt abandoned that PR so I'm ok with this going in as is. When we move to .NET SDK 3.0, we can revisit changing the container.
Co-Authored-By: Tyler James Leonhardt <[email protected]>
Next do vscode-powershell! |
See below link for instructions but basically one just needs to have Docker running in Linux mode with file sharing enabled, install the
ms-vscode-remote.remote-containers
and then just open VS-Code in that folder and use the command to re-open the folder in a container. Because it is early days, one cannot set the default shell to PowerShell yet, but one can define the following user setting to have the shell that is attached to the container starting with PowerShell instead of bash."terminal.integrated.shell.linux": "/usr/bin/pwsh",
https://code.visualstudio.com/docs/remote/containers