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

Update set-up-windows-containers-with-powershell.md #21152

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

stackoverjoe
Copy link
Contributor

Summary

The example Dockerfile did not work. Updated to get tag ltsc2019 which will be installed with powershell 7, so "RUN powershell.." switched to "RUN pwsh..".

The example Dockerfile did not work. Updated to get LTSC which will be installed with powershell 7, so "RUN powershell.." switched to "RUN pwsh..".
@sughosneo
Copy link
Contributor

Hi @stackoverjoe, thank you for submitting this PR.

If you use FROM mcr.microsoft.com/windows/servercore:ltsc2019 then by default it uses PowerShell version 5.

image

And that's the reason while running the step RUN pwsh -Command Add-WindowsFeature Web-Server fails with following error.

image

So it's better to keep the RUN powershell step as is.

FROM mcr.microsoft.com/windows/servercore:ltsc2019
LABEL Description="IIS" Vendor="Microsoft" Version="10"
RUN powershell -Command Add-WindowsFeature Web-Server
CMD [ "ping", "localhost", "-t" ]

And that can be run successfully.

image

Reference

https://devblogs.microsoft.com/dotnet/we-made-windows-server-core-container-images-40-smaller/

@stackoverjoe
Copy link
Contributor Author

Hi @sughosneo thank you for the reply.

I was mistaken by thinking that mcr.microsoft.com/powershell installed the same image on windows! Thank you for the correction!

Return pwsh command to powershell as mcr.microsoft.com/windows/servercore:ltsc2019 installs powershell 5 by default, not 7.
@sughosneo
Copy link
Contributor

Hi @sughosneo thank you for the reply.

I was mistaken by thinking that mcr.microsoft.com/powershell installed the same image on windows! Thank you for the correction!

Looks good ! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants