-
[`4.7`, `latest` (*4.7/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker/blob/master/4.7/Dockerfile) -
[`4.6.2`, (*4.6.2/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker/blob/master/4.6.2/Dockerfile) -
[`3.5` (*3.5/Dockerfile*)](https://github.com/Microsoft/dotnet-framework-docker/blob/master/3.5/Dockerfile)
For more information about these images and their history, please see the relevent Dockerfile (microsoft/dotnet-framework-docker). These images are updated via pull requests to the microsoft/dotnet-framework-docker GitHub repo.
The .NET Framework is a general purpose development platform maintained by Microsoft. It is the most popular way to build client and server applications for Windows and Windows Server. It is included with Windows, Windows Server and Windows Server Core. It includes server technologies such as ASP.NET Web Forms, ASP.NET MVC and Windows Communication Framework (WCF) applications, which you can run in Docker containers.
.NET has several capabilities that make development easier, including automatic memory management, (runtime) generic types, reflection, asynchrony, concurrency, and native interop. Millions of developers take advantage of these capabilities to efficiently build high-quality web and client applications.
You can use C#, F# and VB to write .NET Framework apps. C# is simple, powerful, type-safe, and object-oriented while retaining the expressiveness and elegance of C-style languages. F# is a multi-paradigm programming language, enabling both functional and object-oriented patterns and practices. VB is a rapid development programming language with the deepest integration between the language and Visual Studio, providing the fastest path to a working app.
The .NET Framework was first released by Microsoft in 2001. The latest version is .NET Framework 4.7.
These images are based on Windows Containers. You need to be Windows 10 or Windows Server 2016 to use them.
It is easy to create a Docker image for a .NET Framework 4.x application. You can try the instructions below or check out the .NET Framework 4.7 Docker sample if you want to try a pre-made version that's ready go.
-
Build your application in Visual Studio or at the command line.
-
Add a
Dockerfilefile with the following content to your project. The Dockerfile assumes that your app is built to thebin\Releasedirectory and that your app name isdotnetapp.exe. Please update yourDockerfileas appropriate.FROM microsoft/dotnet-framework:4.7 WORKDIR /app COPY bin/Release . ENTRYPOINT ["dotnetapp.exe"]
-
Type the following Docker commands at the command line, within your project directory (beside Program.cs). You can change the tag name (
dotnetapp) to your own string, as you like.docker build -t dotnetapp . docker run dotnetapp
The Docker image includes the .NET Framework 4.7, however, your application does not need to explicity target the .NET Framework 4.7. Applications that target .NET Framework 4.0 or later should work correctly with this image.
It is easy to create a Docker image for a .NET Framework 3.5 application. You can try the instructions below or check out the .NET Framework 3.5 Docker sample if you want to try a pre-made version that's ready go.
-
Build your application in Visual Studio or at the command line.
-
Add a
Dockerfilefile with the following content to your project. The Dockerfile assumes that your app is built to thebin\Releasedirectory and that your app name isdotnetapp.exe. Please update yourDockerfileas appropriate.FROM microsoft/dotnet-framework:3.5 WORKDIR \app COPY bin\Release . ENTRYPOINT ["dotnetapp.exe"]
-
Type the following Docker commands at the command line, within your project directory (beside Program.cs). You can change the tag name (
dotnetapp) to your own string, as you like.docker build -t dotnetapp . docker run dotnetapp
The Docker image includes the .NET Framework 3.5, however, your application does not need to explicity target the .NET Framework 3.5. Applications that target .NET Framework 1.0 through 3.5 should work correctly with this image.
The microsoft/dotnet-framework images come in different flavors, each designed for a specific use case.
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
This image is for .NET Framework 4.0 and later version applications. It is based on the Windows Server Core image.
This image is for .NET Framework 4.0-4.6.2 applications. It is based on the Windows Server Core image.
This image is for .NET Framework 3.5 and earlier version applications. It is based on the Windows Server Core image.
See .NET Framework Docker samples to get started with pre-made samples.
See .NET Framework and Docker to learn more about using .NET Framework with Docker.
See the following related repos for other application types:
- microsoft/aspnet for ASP.NET Web Forms and MVC images.
- microsoft/dotnet for .NET Core images.
- microsoft/aspnetcore for ASP.NET Core images.
You can read more about Windows Containers to learn how to use Docker with Windows.
The .NET Framework images use the same license as the Windows Server Core base image, as follows:
MICROSOFT SOFTWARE SUPPLEMENTAL LICENSE TERMS
CONTAINER OS IMAGE
Microsoft Corporation (or based on where you live, one of its affiliates) (referenced as “us,” “we,” or “Microsoft”) licenses this Container OS Image supplement to you (“Supplement”). You are licensed to use this Supplement in conjunction with the underlying host operating system software (“Host Software”) solely to assist running the containers feature in the Host Software. The Host Software license terms apply to your use of the Supplement. You may not use it if you do not have a license for the Host Software. You may use this Supplement with each validly licensed copy of the Host Software.
This image is officially supported on Docker version 1.12.2.
Please see Getting Started with Docker for Windows for details on how to install or upgrade Docker to use Windows Containers.
You are invited to report issues or request features by creating a GitHub issue.
You can read documentation for using the .NET Framework with Docker usage in the .NET docs. The docs are open source on GitHub. Contributions are welcome!
