-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Please support PowerShell core on SDK images #360
Comments
Please also make this the default cmd handler in the image |
We would like to hear more requests from the community on this before making a change. Making the Powershell the default |
Would it be possible to create an alternative tag/image that has PowerShell as the default? This would make it so I would not have to create my own base image for all my apps that does the same. Thanks. |
If there is a strong demand for such images then it would be something we would consider. In general we try to limit the number of images permutations as deciphering the differences between all of the images can be difficult. |
Just to give a little context, I use PowerShell so I can create one Dockerfile that works on both Windows and Linux containers even though in many cases the builds are complicated and require scripting. Before I had to maintain two different Dockerfiles and script the same actions in two different languages. Thanks. |
Assume we did add powershell to our SDK images. Why would you need the default shell to be powershell in the dotnet images to enable your scenario? |
Because on Windows the executable name is powershell and on Linux it’s pwsh. So at a minimum I would have to have two base images that set the default shell accordingly and then the multiarch tag. Then all my services would need to reference the multiarch tag. |
I can see how that would be nice, but it's well within your capability to solve. It's not so challenging that it's worth us creating a whole series of additional images to update. We'd have to create ~20 new images to make that work. |
If you add powershell to the base images for the sdk but don't make it the default could you run the following #!/bin/bash This will alias pwsh as powershell and I should be able to set the default myself in a way that would work on both OSs in a single docker file. Thanks. |
That may be a middle ground. First, we need more requests to add powershell. This request is the first one I am aware of. |
Same request to add powershell :)
…________________________________
From: Rich Lander <notifications@github.com>
Sent: Thursday, January 25, 2018 5:36:03 PM
To: dotnet/dotnet-docker
Cc: Subscribed
Subject: Re: [dotnet/dotnet-docker] Please support PowerShell core on SDK images (#360)
That may be a middle ground.
First, we need more requests to add powershell. This request is the first one I am aware of.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#360 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Ady1wL6gUWihKFAPv6dO7ljuebjwut-6ks5tOSwDgaJpZM4RmKQZ>.
|
I second @AceHack on supporting powershell on Linux. It just enable a lot of possibility for development. It also help us make a stronger business case to adopt container technology in our company. |
Same here...this is a much-needed feature for consistency of experiences. |
I would like this feature too. |
I vote for this feature. It will help our company adopt AKS. |
@richlander looking at PowerShell core 6.0.1 it's even called pwsh when installed on windows nanoserver-1709 so just including it would be great! Thanks. |
Anyone know how big it is once installed? |
I'm working on creating a base image myself for nanoserver-1709 and stretch, I'll send the link once I'm done. |
Please do send the link. I'm most interested in what docker history says, so please (for now) add powshell by itself so that it creates a distinct layer. |
@richlander I have not made the multi-arch tag yet, I'll do that tomorrow but here they are on docker hub. Also here are the source Dockerfiles. If you want me to make any changes to help you out just let me know. |
Adding the following to https://github.com/dotnet/dotnet-docker-nightly/blob/master/2.1/sdk/stretch/amd64/Dockerfile results in a layer that is 114 MB.
|
I would like this feature too. |
1 similar comment
I would like this feature too. |
@MichaelSimons you could further reduce the size by removing the .NET core version that comes bundled with PowerShell. I've requested the PS team makes this a first class scenario. |
I would also like this feature |
I would like this feature too |
Please add this feature |
+1 for x-plat targeting - please add this |
Are people even using cmd? |
Is there any chance to use powershell inside the dotnet image? At least for the sdk version, thank you. |
@fabioimpe On our side, we moved everything to Python and stopped using powershell. It makes life much easier, even though we had to re-write our scripts |
Ouch. I can understand the pain, though - if you can't use Microsoft's scripting language in Microsoft's latest images then what's the point. Developers should never have to pay some tax to use such things together. |
I want this feature too,,, |
Same here, I'd really like Powershell in the SDK images. |
The title of this issue is: "Please support PowerShell core on SDK images". I am relatively new to docker so perhaps I don't understand the request but this is how I interpret the request: When I spin up a docker container from the microsoft/dotnet:2.2-sdk docker image, I want to be able to run powershell scripts from within the container without having to install powershell. In other words, powershell is available as a first class shell in the container and all I have to do to run it is to type powershell on the CMD shell that is presented to me when the container starts. If my interpretation is correct then I don't understand the request because I have a microsoft/dotnet:2.2-sdk image in my docker cache that I pulled from dockerhub on Dec. 11, 2018 that has powershell core installed in it. I run Windows 10 and am running the 18.09.1 Community version of both docker server and client. In order to run an interactive container from the aforementioned image, I open a powershell command window with Administrator rights and issue the following command: docker run -it --rm microsoft/dotnet:2.2-sdk Once the container starts up (seems to take about 20 seconds) I issue the 'echo %PATH%' command and get this displayed on my console: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\dotnet;C:\Users\ContainerAdministrator.dotnet\tools (Note the presence of C:\Windows\System32\WindowsPowerShell\v1.0 in the path.) If I then issue the powershell command I'm dropped into a powershell shell. I then issue the $PSVersionTable command from within that powershell shell and I get this output: Name Value PSVersion 5.1.14393.1000 It sure looks to me like Powershell Core is installed in my container. So what am I missing? In other words, why isn't this issue closed? |
@terrip-mpls - This issue is about making PowerShell available in all of the SDK images. Currently PowerShell is only available in the nanoserver-sac2016 flavors because it is included with Nano Server. In the newer versions of Nano Server, PowerShell was removed. PowerShell is not included in any of the Linux images today. |
@MichaelSimons Thank you for such a quick response. I've been banging my head up against a wall for the last couple of days because I couldn't figure out why the version of the microsoft/dotnet:2.2-sdk image in my cache included powershell but when my colleague pulled microsoft/dotnet:2.2-sdk from dockerhub last week his didn't have powershell. I know I never specified anything other than the more generic dotnet:2.2-sdk tag in my docker run command so the version that was published at the time I pulled from dockerhub must have been built with a version of the nanoserver image that included powershell. This solves a mystery and allows us to continue moving forward in our quest to do our CI builds within docker containers. |
I still don't get it. Are we going to have to build the image from scratch now if we want to use Powershell? |
@yamac-kurtulus - if you want to use PowerShell today within one of the microsoft/dotnet images that doesn't already include it, you would have to define a Dockerfile based on the microsoft/dotnet image you want and simply add PowerShell. You can use the existing PowerShell Dockerfiles as a guide for how to do this. Alternatively you can start with one of the PowerShell images and add .NET Core on top of it. |
We are getting closer to adding PowerShell to the .NET Core SDK image. We have landed on the following scenarios as the primary motivations. It would be great to hear if folks have other use cases that you are considering.
|
I have the following use case:
OS targets: nanoserver (2016 and 2019), ubuntu (latest) Conversely, I also have an anti-usecase:
|
Thanks for the follow-up, Rich, but it's no longer a requirement for teams I work with, viz: we migrated to Python scripts for everything. PowerShell/core is just too poorly supported - e.g. in VSTS tasks; other images; and elsewhere. I understand many MSFT teams came to same conclusion, e.g. "az cli" is Python+ other x-plat tools are too. I still use PowerShell locally (great xml+json+collection etc. handing), but Python is liberating with near-perfect cross-platform support + "DreamPie" IDE/multi-line REPL is fast to develop too. |
We use it to install dependencies similar to brew/apt-get, since running
MSIs is not really feasible inside a container.
…On Mon, Feb 4, 2019 at 5:01 PM Rich Lander ***@***.***> wrote:
We are getting closer to adding PowerShell to the .NET Core SDK image. We
have landed on the following scenarios as the primary motivations. It would
be great to hear if folks have other use cases that you are considering.
- Write .NET Core application Dockerfiles with PowerShell syntax for
any OS.
- Write .NET Core application/library build logic that can be easily
containerized. Example: docker run -it -v c:\myrepo:/myrepo -w /myrepo
microsoft/dotnet:3.0-sdk build.ps
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#360 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGYMt2UmN6AFGIUp696j-agV7B49X_Mks5vKLusgaJpZM4RmKQZ>
.
|
Some companies are reluctant to Linux and prefer Windows although they want to use Docker. They want to use Windows images as well. CMD is a terrible scripting environment, not to mention the lack of MSI support, which is required many many many useful applications. My use case, for instance, is to be able to run integration tests using a powershell script inside a nanoserver container. |
If you could, please include what SDK container OS is targeted (e.g. nanoserver, debian, etc) when specifying scenarios per @richlander's request. |
Closing as PowerShell Core is now included in the latest 3.0 preview release. See this announcement for more details. |
@MichaelSimons Your link is not working |
@AceHack - link updated - thanks |
dotnet global tools solve this problem. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 but image gets bulky after this |
Please add powershell core on both linux and windows SDK images
The text was updated successfully, but these errors were encountered: