-2

I can't find a docker file for .NET framework application on linux, i need to run docker build on jenkins that is hosted on ec2 linux server but, only .NET Core can be built on linux.

Aya Abdo
  • 1
  • 2
  • The traditional dotnet framework is only Windows based. Dotnet core is the cross-platform version. What is the problem specificly? does dotnet core not work for you? – medic17 May 09 '22 at 19:35
  • In our case we can't migrate to dotnet core so, we need to find a way to dockerize traditional dotnet framework – Aya Abdo May 09 '22 at 19:43
  • 1
    You should clarify in your post that you are referring to .NET Framework. Naming is important here to distinguish things. You should look into Mono as that is the only way to have .NET Framework code run on Linux: https://www.mono-project.com/. Docker images for Mono are at https://hub.docker.com/_/mono/ – Matt Thalman May 09 '22 at 19:49
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community May 09 '22 at 20:51

1 Answers1

1

Since docker uses the host system kernal you can't run the traditional .NET framework on it while it's host is a linux system. This answer gives more information.

Because of this you have several options:

  1. Host jenkins on a windows server - jenkins is fully cross-platform and can run on a windows EC2 instance. AWS has a container service for Windows see the docs. This would be my recomendation as you already have a production windows server. You can just run a new Windows instance on it. install instructions for jenkins on windows
  2. Retarget asp.NET to .NET 6 or similar so it's supported on linux.
medic17
  • 415
  • 5
  • 16
  • Please try to recommend up-to-date releases (like .NET 6). .NET 5 will reach end of life in just a few days. – Lex Li May 10 '22 at 20:18