Skip to content
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

use pwsh as entrypoint for step scripts instead of powershell #34

Closed
wants to merge 1 commit into from

Conversation

julmb
Copy link

@julmb julmb commented Sep 23, 2021

The current implementation looks for an entrypoint named powershell, which exists in images like mcr.microsoft.com/powershell:windowsservercore-ltsc2022, but not in mcr.microsoft.com/powershell:nanoserver-ltsc2022, where the cross-platform variant pwsh is used. Because of this, only images based on windowsservercore can be used.

The windowsservercore-based image is 5.37GB, while the nanoserver-based image is 553MB, saving a significant amount of space.

The windowsservercore-based images also offer the pwsh command, so by using pwsh as entrypoint instead of powershell, both nanoserver-based and windowsservercore-based images can be used.

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2021

CLA assistant check
All committers have signed the CLA.

@julmb
Copy link
Author

julmb commented Sep 23, 2021

It seems the situation is more complicated than I thought. Here are several packages and what shells they contain:

mcr.microsoft.com/windows/nanoserver:ltsc2022: cmd
mcr.microsoft.com/windows/servercore:ltsc2022: cmd, powershell
mcr.microsoft.com/powershell:nanoserver-ltsc2022: cmd, pwsh
mcr.microsoft.com/powershell:windowsservercore-ltsc2022: cmd, powershell, pwsh
mcr.microsoft.com/dotnet/framework/sdk:4.8: cmd, powershell
mcr.microsoft.com/dotnet/sdk:5.0: cmd, pwsh

WIth how inconsistent this is, maybe the best would be to add the option to configure which shell is used for each step? This could also be useful for operating systems other than windows, where some people might want to use shell-specific features.

@julmb julmb closed this Sep 24, 2021
@julmb julmb deleted the powershell-entrypoint branch September 24, 2021 01:19
@julmb julmb restored the powershell-entrypoint branch September 24, 2021 01:20
@julmb julmb deleted the powershell-entrypoint branch September 24, 2021 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants