dotnet-docker/samples/run-tests-in-sdk-container.md

84 строки
5.0 KiB
Markdown
Исходник Обычный вид История

Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
# Running Tests with Docker
You can use Docker to run your unit tests in an isolated environment using the [.NET SDK Docker image](https://hub.docker.com/_/microsoft-dotnet-sdk/). This is useful if your development and production environments don't match, like, for example, Windows and Linux, respectively. There are multiple ways to run unit tests in containers, which are demonstrated in this document.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
[Building in an SDK container](build-in-sdk-container.md) is a similar scenario and relies on similar patterns. [Building and testing multiple projects with Docker](complexapp/README.md) sample offers additional test patterns that you may want to adopt.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
This document uses the [tests](complexapp/tests) that are part of [complexapp](complexapp). The instructions assume that you are in the [complexapp](complexapp) directory.
The following examples demonstrate using `dotnet test` in a .NET SDK container. It builds tests and dependent projects from source and then runs them. You have to re-launch the container every time you want to test source code changes.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
Alternatively, you can use `dotnet watch test`. This command reruns tests within a running container with every local code change.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
## Requirements
The instructions assume that you have cloned the [repository](https://github.com/dotnet/dotnet-docker) locally.
You may need to enable [shared drives (Windows)](https://docs.docker.com/docker-for-windows/#shared-drives) or [file sharing (macOS)](https://docs.docker.com/docker-for-mac/#file-sharing) first.
Container scenarios that use volume mounting can produce conflicts between the `bin` and `obj` directories in local and container environments. To avoid that, you need to use a different set of `obj` and `bin` folders for your container environment. The easiest way to do that is to copy a custom [Directory.Build.props](Directory.Build.props) into the directory you are using (like the `complexapp` directory in the following example), either via copying from this repo or downloading with the following command:
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```console
curl -o Directory.Build.props https://raw.githubusercontent.com/dotnet/dotnet-docker/main/samples/Directory.Build.props
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```
> Note: You may need to remove `bin` and `obj` directories if you run these instructions on Windows in both Windows and Linux container modes.
## Running tests
You can run `dotnet test` within a .NET SDK container using the following pattern, with `docker run` and volume mounting. This initial example is demonstrated on Windows with PowerShell (in Linux container mode). Instructions for all OSes follow.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```console
> docker run --rm -v ${pwd}:/app -w /app/tests mcr.microsoft.com/dotnet/sdk:8.0 dotnet test
Determining projects to restore...
Restored /app/libbar/libbar.csproj (in 251 ms).
Restored /app/libfoo/libfoo.csproj (in 250 ms).
Restored /app/tests/tests.csproj (in 4.58 sec).
libbar -> /app/libbar/bin/Debug/net8.0/libbar.dll
libfoo -> /app/libfoo/bin/Debug/net8.0/libfoo.dll
tests -> /app/tests/bin/Debug/net8.0/tests.dll
Test run for /app/tests/bin/Debug/net8.0/tests.dll (.NETCoreApp,Version=v8.0)
Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
Copyright (c) Microsoft Corporation. All rights reserved.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Passed! - Failed: 0, Passed: 3, Skipped: 0, Total: 3, Duration: 3 ms - tests.dll (net8.0)
```
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
In this example, the tests (and any other required code) are [volume mounted](https://docs.docker.com/engine/admin/volumes/volumes/) into the container, and `dotnet test` is run from the `tests` directory (`-w` sets the working directory). Test results can be read from the console or from logs, which can be written to disk with the `--logger:trx` flag.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
When the `--logger:trx` flag is used, 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 it 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, which you can search for.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
![Visual Studio Test Results](https://user-images.githubusercontent.com/2608468/35361940-2f5ab914-0118-11e8-9c40-4f252f4568f0.png)
The following instructions demonstrate this scenario in various configurations with logging enabled.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
### Linux or macOS
```console
docker run --rm -v $(pwd):/app -w /app/tests mcr.microsoft.com/dotnet/sdk:8.0 dotnet test --logger:trx
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```
### Windows using Linux containers
This example uses PowerShell.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```console
docker run --rm -v ${pwd}:/app -w /app/tests mcr.microsoft.com/dotnet/sdk:8.0 dotnet test --logger:trx
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```
### Windows using Windows containers
This example uses PowerShell.
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```console
docker run --rm -v ${pwd}:C:\app -w C:\app\tests mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-ltsc2022 dotnet test --logger:trx
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
```
## More Samples
* [.NET Docker Samples](../README.md)
Update samples (#1538) * Simplify sample * Add self-contained instructions * Add containerized build topic * Add complex sample * Move unit testing doc * Add instructions for unit testing * Update text * Rename files * Simplify wording * Rename files * Add explanation of tags * Switch to 'trim' concept * Add complexapp README * Update development in a container * Remove global.json * Update self-contained example * Cleanup wording * Update aspnetapp dockerfiles * Update aspnetapp dockerfiles * Update README * Update aspnetapp numbers * Update testing approach in Dockerfile * Add d.b.p * Add RIDs to restore commands * Fix restore syntax * Add samples build script * Delete old scripts * Remove content from old structure * Rename script * Clean up wording * Update dev in container topic * Switch to dotnet run * Rename files for sdk scenarios * Remove ARM topics * Rename files * Add --rm argument * Put --rm argument in correct spot * Update script * Update nano targets * Update script * Rename files * Update test docs * Update test topics * Update test topics * Update after rebase * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update ENTRYPOINT per feedback * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove instructions for earlier Windows versions * Add Nano Server ARM32 Dockerfile * Add QEMU link * Update samples README * Update headings * Add link to switch modes * Update samples/aspnetapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/aspnetapp/README.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Add console output * Update script * Update * Simply 'final stage' comment * Apply feedback * Update Dockerfile syntax * Update script name * Improve comment * Use local tools for test-samples script * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Switch order of testing instructions * Remove `RUN dontet test` example * Rename `-trim` to `-slim` * Remove arm-specific issue from x64 Dockerfiles * Update formatting * Add 'establishing docker environment' * Add information of establish docker environment * Make script executable * Apply suggestions from code review Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Fix casing * Make script executable * Remove '1803' instances * Update selecting images topic * Add launch settings file * Update text with launchsettings.json * Fix Docker casing * Update tag selection guidance * Update TOC * Update TOC * Fix links * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Update samples/selecting-tags.md Co-Authored-By: Matt Thalman <mthalman@microsoft.com> * Remove old content for Windows containers * Adding logging to script * Remove use of arch-specific SDK tag * Update tag guidance * Limit self-contained Dockerfiles to matching arch * Correct logic for self-contained * Prefer MP tags for SDK * Update samples/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/build-in-sdk-container.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> * Add '--self-contained false' to non-slim Dockerfiles * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Correct syntax for self-contained * Apply suggestions from code review Co-Authored-By: Michael Simons <msimons@microsoft.com> * Update nanoserver-slim * Add link to sample * Add tag to nanoserver-specific build * Update samples/complexapp/README.md Co-Authored-By: Michael Simons <msimons@microsoft.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com> Co-authored-by: Michael Simons <msimons@microsoft.com>
2020-01-15 01:46:27 +03:00
* [.NET Framework Docker Samples](https://github.com/microsoft/dotnet-framework-docker-samples/)