Request for Feedback: Use of PowerShell in the Suite of .NET Docker Images #3672
mthalman
announced in
Announcements
Replies: 1 comment
-
Closing this to reframe the request here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Request for Feedback: Use of PowerShell in the Suite of .NET Docker Images
The .NET team is requesting feedback on the use of PowerShell amongst the full suite of .NET Docker images, including both .NET Core and .NET Framework. There are two aspects that are in question:
There are inconsistencies that exist amongst the set of images, breaking changes to consider, and an opportunity to define the configuration of the upcoming Windows Server Core images for .NET 5.0. We'd like your help in answering some of these questions.
Default Shell
What does shell mean?
Dockerfiles allow for a shell to be defined using the
SHELL
instruction that defines which shell executable is used to execute subsequentRUN
instructions. TheSHELL
instruction only affects how instructions will be executed in the Dockerfile and any other Dockerfiles that are based on the image with thatSHELL
instruction. In other words, it is only relevant when building a Dockerfile. It has no impact on what shell is run by default when you run a container interactively (docker run -i
) or execute commands on a container (docker exec
). Learn more about theSHELL
instruction.Current state of shells
Here is what the landscape looks like for the shell usage across the set of .NET images:
sh
cmd
cmd
cmd
powershell
powershell
powershell
Resolving shell differences
Changing what shell is defined would be a breaking change for a given Docker image. Technically, a change could be made when a new version of Windows is released. For example, when Windows Server, version 2009 is released, the image produced for that version could have its shell set differently from the 2004 version. Of course, that introduces differences in how a dependent Dockerfile is authored between the two versions. Note that a Dockerfile author is able to override the shell from the base image by defining their own
SHELL
instruction.PowerShell Core exists in the SDK images for .NET Core 3.1 and .NET 5.0. This raises the question of whether PowerShell Core (
pwsh
) should be set as the default shell for those images. It's probably only worthwhile to only consider doing this for the images of the upcoming 5.0 release. The benefit of having PowerShell Core defined as the shell across is that you would, by default, have a consistent shell between both Linux and Windows Dockerfiles.Do you find value in having consistency of the shells across the images when pivoting on .NET Core vs .NET Framework, .NET version, repository, OS version? Are you willing to tolerate shell differences between Windows versions in the short-term in order to achieve overall consistency in the long term? Is it better to not mess with changing the default shell of the OS and allow you to set it as you wish? Do you even care what the shell of the base image is since it's easy to override?
The .NET team's opinion has evolved in that we now think defining a default shell should not be done in our images. It is often misunderstood and we feel it's best left to consumers of the image to decide which shell to use should it be anything other than the OS default.
PowerShell Core Availability
As part of the upcoming Windows Server Core images for .NET 5.0, we have the opportunity to consider what should be installed in those new images. Since the base Windows Server Core images have PowerShell installed by default, PowerShell will simply be a given in these new images across all repositories (runtime, sdk, etc). The question is whether PowerShell Core should also be installed for the SDK images for Windows Server Core in order to provide consistency with the other SDK images for Linux and Nano Server.
And since we're talking about installing PowerShell Core, what about the .NET Framework SDK images? Do you see value in providing PowerShell Core there?
And if PowerShell Core is added to any of these images, should it also be defined as the default shell?
Options
There are a lot of variations of options available here, with options that can be mixed and matched. Please let us know what you think.
cmd
set as the shell.Beta Was this translation helpful? Give feedback.
All reactions