This repository contains Dockerfile
definitions for dotnet/cli Docker images.
This project is part of .NET Core command-line (CLI) tools. You can find samples, documentation, and getting started instructions for .NET Core CLI tools on our getting started page.
-
[`0.0.1-alpha`, (*0.0.1-alpha/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/Dockerfile)
-
[`0.0.1-alpha-onbuild`, (*0.0.1-alpha/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/onbuild/Dockerfile)
-
[`1.0.0-preview1`, `latest` (*1.0.0-preview1/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/Dockerfile)
-
[`1.0.0-preview1-onbuild`, `onbuild` (*1.0.0-preview1/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/onbuild/Dockerfile)
-
[`1.0.0-rc2-core-deps`, `core-deps` (*1.0.0-rc2/core-deps/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-rc2/core-deps/Dockerfile)
-
[`1.0.0-rc2-core`, `core` (*1.0.0-rc2/core/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-rc2/core/Dockerfile)
The microsoft/dotnet
image come in different flavors, each designed for a specific use case.
This image contains the .NET Core SDK which is comprised of two parts:
- .NET Core
- .NET Core command line tools
This image is recommended if you are trying .NET Core for the first time, as it allows both developing and running applications. Use this image for your development process (developing, building and testing applications).
The most straightforward way to use this image is to use a .NET container as both the build and runtime environment. In your Dockerfile
, writing something along the lines of the following will compile and run your project:
FROM microsoft/dotnet:onbuild
This image includes multiple ONBUILD
triggers which should cover most applications. The build will COPY . /dotnetapp
and RUN dotnet restore
.
This image also includes the ENTRYPOINT dotnet run
instruction which will run your application when the Docker image is run.
You can then build and run the Docker image:
$ docker build -t my-dotnet-app .
$ docker run -it --rm --name my-running-app my-dotnet-app
This image contains the operating system with all of the native dependencies needed by .NET Core. Use this image to:
- Run a self-contained application.
- Build a custom copy of .NET Core by compiling coreclr and corefx.
This image contains only .NET Core (runtime and libraries) and it is optimized for running portable .NET Core applications. If you wish to run self-contained applications, please use the core-deps
image described above.