Skip to content

Commit b9ba537

Browse files
authored
Cleanup READMEs (dotnet#107)
* Cleanup READMEs * Add Test Results image * Fix image link * Fix image link * Update per feedback
1 parent 859850b commit b9ba537

File tree

2 files changed

+22
-37
lines changed

2 files changed

+22
-37
lines changed

README.md

+17-35
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,54 @@
11
# .NET Core Docker Samples
22

3-
This repo contains samples that demonstrate various .NET Core Docker configurations, which you can use as the basis of your own Docker images. They are also generally useful .NET Core samples and provide instructions for use with and without Docker.
3+
This repo contains samples that demonstrate various .NET Core Docker configurations, which you can use as the basis of your own Docker images. The samples can also be used with and without Docker.
44

5-
These samples depend on the [.NET Core Docker images](https://hub.docker.com/r/microsoft/dotnet/) on Docker Hub, provided by the .NET Team at Microsoft.
6-
7-
Docker uses [docker/whalesay](https://hub.docker.com/r/docker/whalesay/) as a getting started sample. The .NET Core Team at Microsoft uses [dotnetbot](https://github.com/dotnet-bot), which is the mascot for .NET open source projects. Got something to say? Both whalesay and dotnetbot are great listeners. The [dotnetapp-dev](dotnetapp-dev), [dotnetapp-prod](dotnetapp-prod), and [dotnetapp-selfcontained](dotnetapp-selfcontained) samples all simply print a "Welcome!" message to the console. The [aspnetapp](aspnetapp) sample starts a basic ASP.NET Core website running in a container that you can browse to locally.
8-
9-
You can pick the sample that best fits the scenario you are interested in. The instructions for each sample describe how to target [Windows](http://aka.ms/windowscontainers) or Linux Docker images, from Windows, Linux or macOS.
10-
11-
The samples use .NET Core 2.0. They use Docker [multi-stage build](https://github.com/dotnet/announcements/issues/18) and [multi-arch tags](https://github.com/dotnet/announcements/issues/14) where appropriate.
12-
13-
You need to have the [.NET Core SDK](https://www.microsoft.com/net/download/core#/sdk) and [Git](https://git-scm.com/downloads) and [Docker client 17.06 or newer](https://www.docker.com/products/docker) clients installed to use these samples.
5+
You can pick the sample that best fits the scenario you are interested in, on Windows, macOS or Linux.
146

157
## Getting Started
168

17-
You can run a [sample application](https://hub.docker.com/r/microsoft/dotnet-samples/) that runs from a pre-built image that has been published to Docker Hub. The source of this sample application is the [dotnetapp-prod](dotnetapp-prod) sample.
9+
You can run a pre-built [.NET Core sample](https://hub.docker.com/r/microsoft/dotnet-samples/) using [Docker](https://www.docker.com/products/docker). The source of this sample application is the [dotnetapp-prod](dotnetapp-prod) sample.
1810

19-
To run the **Linux** image:
11+
Type the following command to run the sample:
2012

2113
```console
2214
docker run microsoft/dotnet-samples
2315
```
2416

25-
To run the **Windows** image:
26-
27-
```console
28-
docker run microsoft/dotnet-samples:dotnetapp-nanoserver
29-
```
30-
31-
It is recomended to run the sample twice. The second run will not include downloading the image, so is more representative of typical Docker use.
32-
3317
## Samples
3418

35-
The following samples show different ways to use .NET Core images.
19+
The following samples show different ways to use .NET Core images. They depend on the [.NET Core 2.0 Docker images](https://hub.docker.com/r/microsoft/dotnet/) on Docker Hub, provided by the .NET Team at Microsoft. They use Docker [multi-stage build](https://github.com/dotnet/announcements/issues/18) and [multi-arch tags](https://github.com/dotnet/announcements/issues/14) where appropriate.
3620

37-
### Development
21+
### Building .NET Core Apps with Docker
3822

39-
* [.NET Core Development Sample](dotnetapp-dev) - This sample is good for development and building since it relies on the .NET Core SDK image. It performs `dotnet` commands on your behalf, reducing the time it takes to create Docker images (assuming you make changes and then test them in a container, iteratively).
23+
* [.NET Core "Starter" Docker Sample](dotnetapp-prod) - This sample builds and runs a single project in Docker. It's a simple sample to start with.
24+
* [.NET Core End-to-End Docker Sample](dotnetapp-dev) - This sample builds, tests and runs the sample using Docker. It includes and builds multiple projects.
25+
* [ASP.NET Core Docker Sample](aspnetapp) - This samples demonstrates a Dockerized ASP.NET Core Web App.
4026

41-
### Production
27+
### Optimizing Container Size
4228

43-
* [.NET Core Docker Production Sample](dotnetapp-prod) - This sample is good for production since it relies on the .NET Core Runtime image, not the larger .NET Core SDK image. Most apps only need the runtime, reducing the size of your application image.
4429
* [.NET Core self-contained application Docker Production Sample](dotnetapp-selfcontained) - This sample is also good for production scenarios since it relies on an operating system image (without .NET Core). [Self-contained .NET Core apps](https://docs.microsoft.com/dotnet/articles/core/deploying/) include .NET Core as part of the app and not as a centrally installed component in a base image.
45-
* [ASP.NET Core Docker Production Sample](aspnetapp) - This samples demonstrates a Dockerized ASP.NET Core Web App.
30+
* [.NET Core Docker Alpine Production Sample](dotnetapp-prod-alpine-preview) - This sample illustrates how to use the new lightweight Alpine based .NET Core Runtime image that is currently in preview.
31+
32+
> Related: See [.NET Core Alpine Docker Image announcement](https://github.com/dotnet/dotnet-docker-nightly/issues/500)
4633
4734
### ARM32 / Raspberry Pi
4835

4936
* [.NET Core Docker Production Sample](dotnetapp-prod) - This sample includes instructions for running a runtime image with Linux on a Raspberry Pi.
5037
* [.NET Core self-contained application Docker Production Sample](dotnetapp-selfcontained) - This sample includes instructions for running a self-contained image with Linux on a Raspberry Pi.
5138
* Related: See [.NET Core on Raspberry Pi](https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md)
5239

53-
### Alpine Preview
54-
55-
* [.NET Core Docker Alpine Production Sample](dotnetapp-prod-alpine-preview) - This sample illustrates how to use the new lightweight Alpine based .NET Core Runtime image that is currently in preview.
56-
57-
* Related: See [.NET Core Alpine Docker Image announcement](https://github.com/dotnet/dotnet-docker-nightly/issues/500)
58-
5940
## Related Repositories
6041

6142
See the following related Docker Hub repos:
6243

44+
* [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images.
45+
* [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) for ASP.NET Core images.
6346
* [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) for .NET Core images.
6447
* [microsoft/dotnet-samples](https://hub.docker.com/r/microsoft/dotnet-samples/) for .NET Core sample images.
65-
* [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) for ASP.NET Core images.
66-
* [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images.
6748
* [microsoft/dotnet-framework](https://hub.docker.com/r/microsoft/dotnet-framework/) for .NET Framework images (for web applications, see microsoft/aspnet).
49+
* [microsoft/dotnet-framework-samples](https://hub.docker.com/r/microsoft/dotnet-framework-samples/) for .NET Framework sample images.
6850

6951
See the following related GitHub repos:
7052

71-
* [dotnet/announcements](https://github.com/dotnet/announcements/issues?q=is%3Aissue+is%3Aopen+label%3ADocker) for Docker-related announcements.
53+
* [dotnet/announcements](https://github.com/dotnet/announcements/labels/Docker) for Docker-related announcements.
7254
* [microsoft/dotnet-framework-docker-samples](https://github.com/microsoft/dotnet-framework-docker-samples/) for .NET Framework samples.

dotnetapp-dev/README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ The unit tests in this sample will run as part of the the `docker build` command
3939
public void Test1()
4040
{
4141
var inputString = "Dotnet-bot: Welcome to using .NET Core!";
42-
var expectedString = "Dotnet-bot: Welcome to using .NET Core!";
42+
// var expectedString = "!eroC TEN. gnisu ot emocleW :tob-tentoD";
43+
var expectedString = "arbitrarily different string - won't match";
4344
var actualString = ReverseUtil.ReverseString(inputString);
4445
Assert.True(actualString == expectedString, "The input string was not reversed correctly.");
4546
}
@@ -83,7 +84,9 @@ You can run the sample on **macOS** or **Linux** using the following command. Yo
8384
docker run --rm -v "$(pwd)"/TestResults:/app/tests/TestResults dotnetapp-dev:test
8485
```
8586

86-
You should find a `.trx` file in the TestResults folder. You can open this file in Visual Studio to see the results of the test run. You can open in Visual Studio (File -> Open -> File)or double-click on the TRX file (if you have Visual Studio installed). There are other TRX file viewers available as well that you can search for.
87+
You should find a `.trx` file in the TestResults folder. You can open this file in Visual Studio to see the results of the test run, as you can see in the following image. You can open in Visual Studio (File -> Open -> File) or double-click on the TRX file (if you have Visual Studio installed). There are other TRX file viewers available as well that you can search for.
88+
89+
![Visual Studio Test Results](https://user-images.githubusercontent.com/2608468/35361940-2f5ab914-0118-11e8-9c40-4f252f4568f0.png)
8790

8891
The unit testing in this Dockerfile demonstrates a couple approaches to unit testing with Docker. If you adopt this Dockerfile, you don't need to use both or either of these approaches. They are patterns that we considered useful for the unit testing use case.
8992

0 commit comments

Comments
 (0)