-
Notifications
You must be signed in to change notification settings - Fork 334
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
Image with multiple SDKs #731
Comments
[Triage] This topic of multi-purpose images is an interesting to us. We could add the multiple runtimes to support this scenario. The downside is that it adds more to an already large image. We don't have a sense for how many users would make use of the multiple runtimes. We think a multi-stage Dockerfile could be utilized here. The idea is to use different stages specific to each target framework. We would like to see someone create a proof of concept that illustrates this idea and possibly incorporate it into our samples. |
The most obvious way is to build out your own images with all of the targets you want installed. After reading another related issue and from my own experience, I think the problem is the number of different ways to do this and it not being clear the correct way. For example, you can install things with chocolatey, nuget, powershell, msi etc. and the urls to obtained some of the msi's change over time. If we could find a really consistent way to do this then the clean way would be something like: FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 AS base
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
Add-AppxPackage https://consistently.named.url/netsdk/sdk48.msix
Add-AppxPackage https://consistently.named.url/netsdk/sdknetstandard21.msix
Add-AppxPackage https://consistently.named.url/netsdk/sdk5.msix Note that I am also opposed to just inventing another new thing that just makes all of this even more confusing! |
So, what's wrong with |
I guess getting where "choco install" actually works and doesn't throw an error? 🤔 |
This works for me without any errors: FROM mcr.microsoft.com/windows/servercore:20H2
# Chocolatey install command is taken from its website: https://chocolatey.org/install
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
RUN choco install -y netfx-4.7.2-devpack What error are you talking about? |
There's an alternative way: use VS Build Tools (or even Visual Studio) installer, since you most likely would need things like MSBuild and others from it anyway: FROM mcr.microsoft.com/windows/servercore:20H2
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:/
RUN C:/vs_buildtools.exe --quiet --wait --nocache \
--add Microsoft.Net.Component.4.7.2.SDK \
--add Microsoft.Net.Component.4.7.2.TargetingPack Refer to docs for a list of available component ids. |
Describe the Problem
More and more CI tools like CircleCI and AWS CodeBuild are based on executing the process in containers. This works really fine when creating applications that are bound to a single target framework.
The same unfortunately can't be said when packaging a library that targets multiple frameworks, especially when executing the tests.
An example is a solution with
In cases like this, you need to orchestrate a build across multiple containers. While working, you lose the advantages of having artifacts and test results coming from the same execution (this is a problem i am experiencing with CircleCI.
Describe the Solution
Ideally it would be nice if there were images that included multiple runtimes and SDKs.
Best options would be
Alternatively, it would be acceptable for me if you could publish a guide with a series of concrete steps to achieve the same.
Additional Context
I was encouraged to open this issue from a conversation in Twitter: https://twitter.com/Kralizek/status/1360295293426806793
The text was updated successfully, but these errors were encountered: