aspnet / aspnet-docker

[Archived] ASP.NET Core Docker images for 1.x. Go to https://github.com/dotnet/dotnet-docker for 2.1 and up.
https://asp.net
719 stars 171 forks source link

Multi-Targeting .NET Framework & .NET Core #308

Closed RehanSaeed closed 6 years ago

RehanSaeed commented 7 years ago

Steps to reproduce the issue

I'd like to be able to build my project targeting .NET Framework and .NET Core.

Expected behavior

A docker image exists with both the .NET Framework (Mono) and .NET Core.

Actual behavior

No such image exists.

Additional information

I was not certain where to raise this issue but I thought I'd get the ball rolling here. I''ve also raised an issue in the mono repo here.

I've also raised a similar issue here in the aspnet/aspnet-win-docker repo to add a similar image for the windows containers.

natemcmaster commented 7 years ago

FYI - the .NET Core SDK itself does not support targeting .NET Framework on any platform but Windows. https://github.com/dotnet/sdk/issues/335.

I've also raised a similar issue here in the aspnet/aspnet-win-docker repo to add a similar image for the windows containers.

This is the repo to use for both Linux and Nano Server containers for ASP.NET Core.

RehanSaeed commented 7 years ago

Yes I'm aware of that, you can still get it working with Mono with a bit of work. It becomes more important when the feature in your linked issue is implemented.

Having a Windows image with .NET Framework and .NET Core would still be useful.

natemcmaster commented 7 years ago

Since we don't have an image for this today, you will need to build your own. You can probably do this by combining elements from the following images:

https://github.com/Microsoft/aspnet-docker/blob/master/4.7/Dockerfile, https://github.com/dotnet/dotnet-docker/blob/master/2.0/sdk/nanoserver/amd64/Dockerfile, and https://github.com/aspnet/aspnet-docker/blob/master/2.0/nanoserver/sdk/Dockerfile.

Or, consider using a multi-stage build using microsoft/aspnet and microsoft/aspnetcore.

natemcmaster commented 6 years ago

Closing in favor of https://github.com/dotnet/sdk/issues/335. Docker isn't the right layer for adding support for this.