-
Notifications
You must be signed in to change notification settings - Fork 148
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
Consider setting the SHELL to pwsh in Docker images #394
Comments
I could be mistaken... but I think 'SHELL' only applies to the 'RUN' in the DockerFile. I was doing something similar for use of AWSPowerShell .Net Core SDK and I was able to get this working use case working like this:
Then I run |
Shell is already set as @tehshwann explains it has limited scope. |
Please file docker image question in PowerShell/PowerShell-Docker for faster triage. |
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes. |
When I get time, I am considering changing the entry point and command to have a similar effect. |
You are correct. That is the purpose of the
I don't see it set in the PS images. You can test it out yourself by building the following Dockerfile. It will fail while running
I see it set in the Nano Server Dockerfiles but it is only set in the Please consider changing this as it really does make the PS images more useful. I should also point out if you do consider making this change, it should only be done during the next major/minor release as it should be considered a breaking change. |
I agree with the change, but it would be a breaking change for customers that assume that the shell is bash or cmd . |
Had an offline conversation with @TravisEz13. Totally agree that this would be the right thing to do if we were starting fresh, but it's a pretty significant change for both Windows and Linux users. @MichaelSimons do you or anyone on the .NET team have any experience with making such significant changes to a shipping production container image? Is there some kind of transition path that we can build to make things less (or altogether not) breaking? |
@PowerShell/powershell-committee reviewed this. This is too big of a breaking change to accept at this time. The workaround to set the shell default seems acceptable or calling pwsh explicitly. |
Steps to reproduce
Build the following Dockerfile
Expected behavior
docker build
would succeed. I was expecting the SHELL would be set to pwsh in the powershell images.SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
This makes it easy to use the PS 'out of the box' in Dockerfiles based on microsoft/powershell.
Actual behavior
docker build
fails with the following errorThe text was updated successfully, but these errors were encountered: