+ADw-div+AD4APA-p+AD4-I love me some Raspberry Pi. They are great little learning machines and are super fun for kids to play with. Even if those +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://www.hanselman.com/blog/HowToBuildAKubernetesClusterWithARMRaspberryPiThenRunNETCoreOnOpenFaas.aspx+ACIAPg-kids are adults and they build a 6 node Kubernetes Raspberry Pi Cluster+ADw-/a+AD4.+ADw-/p+AD4 +ADw-p+AD4-Open source .NET Core runs basically everywhere - Windows, Mac, and a dozen Linuxes. However, there is an SDK (that compiles and builds) and a Runtime (that does the actual running of your app). In the past, the .NET Core SDK (to be clear, the ability to +ACI-dotnet build+ACI) wasn't supported on ARMv7/ARMv8 chips like the Raspberry Pi. Now it is.+ADw-/p+AD4 +ADw-blockquote+AD4 +ADw-p+AD4APA-strong+AD4.NET Core is now supported on Linux ARM32 distros, like +ADw-/strong+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://www.raspberrypi.org/downloads/+ACIAPgA8-strong+AD4-Raspbian+ADw-/strong+AD4APA-/a+AD4APA-strong+AD4 and +ADw-/strong+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://www.ubuntu.com/download/server/arm+ACIAPgA8-strong+AD4-Ubuntu+ADw-/strong+AD4APA-/a+AD4AIQA8-/p+AD4APA-/blockquote+AD4 +ADw-p+AD4APA-strong+AD4-Note:+ADw-/strong+AD4 .NET Core 2.1 is supported on Raspberry Pi 2+ACs. It isn+IBk-t supported on the Pi Zero or other devices that use an ARMv6 chip. .NET Core requires ARMv7 or ARMv8 chips, like the +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://en.wikipedia.org/wiki/ARM+AF8-Cortex-A53+ACIAPg-ARM Cortex-A53+ADw-/a+AD4. Folks on the +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/Azure/iot-edge+ACIAPg-Azure IoT Edge+ADw-/a+AD4 team use the .NET Core Bionic ARM32 Docker images to support developers +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/Azure/iot-edge/blob/master/v2/samples/azureiotedge-simulated-temperature-sensor/README.md+ACIAPg-writing C+ACM with Edge devices+ADw-/a+AD4.+ADw-/p+AD4 +ADw-p+AD4-There's two ways to run .NET Core on a Raspberry Pi. +ADw-/p+AD4 +ADw-p+AD4APA-strong+AD4-One, use +ADw-/strong+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/+ACIAPgA8-strong+AD4-Docker+ADw-/strong+AD4APA-/a+AD4APA-strong+AD4.+ADw-/strong+AD4 This is literally the fastest and easiest way to get .NET Core up and running on a Pi. It sounds crazy but Raspberry Pis are brilliant little Docker container capable systems. You can do it in minutes, truly. You can install Docker quickly on a Raspberry Pi with just:+ADw-/p+AD4APA-pre+AD4-curl -sSL https://get..com +AHw sh +ADw-br+AD4-sudo usermod -aG docker pi+ADw-/pre+AD4 +ADw-p+AD4-After installing Docker you'll want to log in and out. You might want to try a quick sample to make sure .NET Core runs+ACE You can explore the available Docker tags at +ADw-a title+AD0AIg-https://hub.docker.com/r/microsoft/dotnet/tags/+ACI href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hub.docker.com/r/microsoft/dotnet/tags/+ACIAPg-https://hub.docker.com/r/microsoft/dotnet/tags/+ADw-/a+AD4 and you can read about the .NET Core Docker samples here +ADw-a title+AD0AIg-https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp+ACI href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp+ACIAPg-https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp+ADw-/a+AD4APA-/p+AD4 +ADw-p+AD4-Now I can just docker run and then pass in +ACI-dotnet --info+ACI to find out about dotnet on my Pi.+ADw-/p+AD4APA-pre+AD4-pi+AEA-raspberrypi:+AH4 +ACQ docker run --rm -it microsoft/dotnet:2.1-sdk dotnet --info +ADw-br+AD4.NET Core SDK (reflecting any global.json): +ADw-br+AD4 Version: 2.1.300-rc1-008673 +ADw-br+AD4 Commit: f5e3ddbe73 +ADw-br+AD4 +ADw-br+AD4-Runtime Environment: +ADw-br+AD4 OS Name: debian +ADw-br+AD4 OS Version: 9 +ADw-br+AD4 OS Platform: Linux +ADw-br+AD4 RID: debian.9-x86 +ADw-br+AD4 Base Path: /usr/share/dotnet/sdk/2.1.300-rc1-008673/ +ADw-br+AD4 +ADw-br+AD4-Host (useful for support): +ADw-br+AD4 Version: 2.1.0-rc1 +ADw-br+AD4 Commit: eb9bc92051 +ADw-br+AD4 +ADw-br+AD4.NET Core SDKs installed: +ADw-br+AD4 2.1.300-rc1-008673 +AFs-/usr/share/dotnet/sdk+AF0 +ADw-br+AD4 +ADw-br+AD4.NET Core runtimes installed: +ADw-br+AD4 .NETCore.App 2.1.0-rc1 +AFs-/usr/share/dotnet/shared/Microsoft.NETCore.App+AF0 +ADw-br+AD4 +ADw-br+AD4-To install additional .NET Core runtimes or SDKs: +ADw-br+AD4 https://aka.ms/dotnet-download+ADw-/pre+AD4 +ADw-p+AD4-This is super cool. There I'm on the Raspberry Pi (RPi) and I just ask for the dotnet:2.1-sdk and because they are using +ACI-multiarch+ACI docker files, Docker does the right thing and it just works. If you want to use +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-arm32.md+ACIAPg.NET Core on ARM32 with Docker+ADw-/a+AD4, you can use any of the following tags. +ADw-p+AD4APA-strong+AD4-Note: +ADw-/strong+AD4APA-em+AD4-The first three tags are +ADw-/em+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/announcements/issues/14+ACIAPgA8-em+AD4-multi-arch+ADw-/em+AD4APA-/a+AD4APA-em+AD4 +ADw-/em+AD4-and +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hub.docker.com/+AF8-/ubuntu/+ACIAPg-bionic+ADw-/a+AD4 is Ubuntu 18.04. The codename +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hub.docker.com/+AF8-/debian/+ACIAPg-stretch+ADw-/a+AD4 is Debian 9. So I'm using 2.1-sdk and it's working on my RPi, but I can be specific if I'd prefer. +ADw-ul+AD4 +ADw-li+AD4-2.1-sdk +ADw-li+AD4-2.1-runtime +ADw-li+AD4-2.1-aspnetcore-runtime +ADw-li+AD4-2.1-sdk-stretch-arm32v7 +ADw-li+AD4-2.1-runtime-stretch-slim-arm32v7 +ADw-li+AD4-2.1-aspnetcore-runtime-stretch-slim-arm32v7 +ADw-li+AD4-2.1-sdk-bionic-arm32v7 +ADw-li+AD4-2.1-runtime-bionic-arm32v7 +ADw-li+AD4-2.1-aspnetcore-runtime-bionic-arm32v7+ADw-/li+AD4APA-/ul+AD4 +ADw-p+AD4-Try one in minutes like this:+ADw-/p+AD4APA-pre+AD4-docker run --rm microsoft/dotnet-samples:dotnetapp+ADw-/pre+AD4 +ADw-p+AD4-Here it is downloading the images...+ADw-/p+AD4 +ADw-p+AD4APA-img title+AD0AIg-Docker on a Raspberry Pi+ACI style+AD0AIg-border-left-width: 0px+ADs border-right-width: 0px+ADs background-image: none+ADs border-bottom-width: 0px+ADs padding-top: 0px+ADs padding-left: 0px+ADs display: inline+ADs padding-right: 0px+ADs border-top-width: 0px+ACI border+AD0AIg-0+ACI alt+AD0AIg-Docker on a Raspberry Pi+ACI src+AD0AIg-https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/67a54ca88e34+AF8-E5AC/image+AF8-2c7f0663-2ccd-4dd8-b5a8-ac69a3f50d6e.png+ACI width+AD0AIg-642+ACI height+AD0AIg-121+ACIAPgA8-/p+AD4 +ADw-p+AD4-In previous versions of .NET Core's Dockerfiles it would fail if you were running an x64 image on ARM:+ADw-/p+AD4APA-pre+AD4-standard+AF8-init+AF8-linux.go:190: exec user process caused +ACI-exec format error+ACIAPA-/pre+AD4 +ADw-p+AD4-Different processors+ACE But with multiarch per +ADw-a title+AD0AIg-https://github.com/dotnet/announcements/issues/14+ACI href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/announcements/issues/14+ACIAPg-https://github.com/dotnet/announcements/issues/14+ADw-/a+AD4 Kendra from Microsoft it just works with 2.1.+ADw-/p+AD4 +ADw-blockquote+AD4 +ADw-p+AD4-Docker has a +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/moby/moby/issues/15866+ACIAPg-multi-arch feature+ADw-/a+AD4 that +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hub.docker.com/r/microsoft/dotnet-nightly/+ACIAPg-microsoft/dotnet-nightly+ADw-/a+AD4 recently started utilizing. The plan is to port this to the +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hub.docker.com/r/microsoft/dotnet/+ACIAPg-official microsoft/dotnet repo+ADw-/a+AD4 shortly. The multi-arch feature allows a single tag to be used across multiple machine configurations. Without this feature each architecture/OS/platform requires a unique tag. For example, the microsoft/dotnet:1.0-runtime tag is based on Debian and microsoft/dotnet:1.0-runtime-nanoserver if based on Nano Server. With multi-arch there will be one common microsoft/dotnet:1.0-runtime tag. If you pull that tag from a Linux container environment you will get the Debian based image whereas if you pull that tag from a Windows container environment you will get the Nano Server based image. This helps provide tag uniformity across Docker environments thus eliminating confusion.+ADw-/p+AD4APA-/blockquote+AD4 +ADw-p+AD4-In these examples above I can:+ADw-/p+AD4 +ADw-ul+AD4 +ADw-li+AD4-Run a preconfigured app within a Docker image like: +ADw-ul+AD4 +ADw-li+AD4-docker run --rm microsoft/dotnet-samples:dotnetapp+ADw-/li+AD4APA-/ul+AD4 +ADw-li+AD4-Run dotnet commands within the SDK image like: +ADw-ul+AD4 +ADw-li+AD4-docker run --rm -it microsoft/dotnet:2.1-sdk dotnet --info+ADw-/li+AD4APA-/ul+AD4 +ADw-li+AD4-Run an interactive terminal within the SDK image like: +ADw-ul+AD4 +ADw-li+AD4-docker run --rm -it microsoft/dotnet:2.1-sdk+ADw-/li+AD4APA-/ul+AD4APA-/li+AD4APA-/ul+AD4 +ADw-p+AD4-As a quick example, here I'll jump into a container and new up a quick console app and run it, just to prove I can. This work will be thrown away when I exit the container.+ADw-/p+AD4APA-pre+AD4-pi+AEA-raspberrypi:+AH4 +ACQ docker run --rm -it microsoft/dotnet:2.1-sdk +ADw-br+AD4-root+AEA-063f3c50c88a:/+ACM ls +ADw-br+AD4-bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var +ADw-br+AD4-root+AEA-063f3c50c88a:/+ACM cd +AH4 +ADw-br+AD4-root+AEA-063f3c50c88a:+AH4AIw mkdir mytest +ADw-br+AD4-root+AEA-063f3c50c88a:+AH4AIw cd mytest/ +ADw-br+AD4-root+AEA-063f3c50c88a:+AH4-/mytest+ACM dotnet new console +ADw-br+AD4-The template +ACI-Console Application+ACI was created successfully. +ADw-br+AD4 +ADw-br+AD4-Processing post-creation actions... +ADw-br+AD4-Running 'dotnet restore' on /root/mytest/mytest.csproj... +ADw-br+AD4 Restoring packages for /root/mytest/mytest.csproj... +ADw-br+AD4 Installing Microsoft.NETCore.DotNetAppHost 2.1.0-rc1. +ADw-br+AD4 Installing Microsoft.NETCore.DotNetHostResolver 2.1.0-rc1. +ADw-br+AD4 Installing NETStandard.Library 2.0.3. +ADw-br+AD4 Installing Microsoft.NETCore.DotNetHostPolicy 2.1.0-rc1. +ADw-br+AD4 Installing Microsoft.NETCore.App 2.1.0-rc1. +ADw-br+AD4 Installing Microsoft.NETCore.Platforms 2.1.0-rc1. +ADw-br+AD4 Installing Microsoft.NETCore.Targets 2.1.0-rc1. +ADw-br+AD4 Generating MSBuild file /root/mytest/obj/mytest.csproj.nuget.g.props. +ADw-br+AD4 Generating MSBuild file /root/mytest/obj/mytest.csproj.nuget.g.targets. +ADw-br+AD4 Restore completed in 15.8 sec for /root/mytest/mytest.csproj. +ADw-br+AD4 +ADw-br+AD4-Restore succeeded. +ADw-br+AD4-root+AEA-063f3c50c88a:+AH4-/mytest+ACM dotnet run +ADw-br+AD4-Hello World+ACE +ADw-br+AD4-root+AEA-063f3c50c88a:+AH4-/mytest+ACM dotnet exec bin/Debug/netcoreapp2.1/mytest.dll +ADw-br+AD4-Hello World+ACEAPA-/pre+AD4 +ADw-p+AD4-If you try it yourself, you'll note that +ACI-dotnet run+ACI isn't very fast. That's because it does a restore, build, and run. Compilation isn't super quick on these tiny devices. You'll want to do as little work as possible. Rather than a +ACI-dotnet run+ACI all the time, I'll do a +ACI-dotnet build+ACI then a +ACI-dotnet exec+ACI which is very fast.+ADw-/p+AD4 +ADw-p+AD4-If you're doing to do Docker and .NET Core, +ADw-strong+AD4-I can't stress enough how useful the resources are over at +ADw-/strong+AD4APA-a title+AD0AIg-https://github.com/dotnet/dotnet-docker+ACI href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker+ACIAPgA8-strong+AD4-https://github.com/dotnet/dotnet-docker+ADw-/strong+AD4APA-/a+AD4APA-strong+AD4.+ADw-/strong+AD4 +ADw-/p+AD4 +ADw-h3+AD4-Building .NET Core Apps with Docker+ADw-/h3+AD4 +ADw-ul+AD4 +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/README.md+ACIAPg.NET Core Docker Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile+ACIAPg-sample+ADw-/a+AD4 builds, tests, and runs the sample. It includes and builds multiple projects. +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/README.md+ACIAPg-ASP.NET Core Docker Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile+ACIAPg-sample+ADw-/a+AD4 demonstrates using Docker with an ASP.NET Core Web App.+ADw-/li+AD4APA-/ul+AD4 +ADw-h3+AD4-Develop .NET Core Apps in a Container+ADw-/h3+AD4 +ADw-ul+AD4 +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-dev-in-container.md+ACIAPg-Develop .NET Core Applications+ADw-/a+AD4 - This sample shows develop, build and test .NET Core applications with Docker without the need to install the .NET Core SDK. +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/aspnet-docker-dev-in-container.md+ACIAPg-Develop ASP.NET Core Applications+ADw-/a+AD4 - This sample shows how to develop and test ASP.NET Core applications with Docker without the need to install the .NET Core SDK.+ADw-/li+AD4APA-/ul+AD4 +ADw-h3+AD4-Optimizing Container Size+ADw-/h3+AD4 +ADw-ul+AD4 +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/README.md+ACIAPg.NET Core Alpine Docker Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.alpine-x64+ACIAPg-sample+ADw-/a+AD4 builds, tests, and runs an application using Alpine. +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-selfcontained.md+ACIAPg.NET Core self-contained Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.debian-x64-selfcontained+ACIAPg-sample+ADw-/a+AD4 builds and runs an application as a self-contained application.+ADw-/li+AD4APA-/ul+AD4 +ADw-h3+AD4-ARM32 / Raspberry Pi+ADw-/h3+AD4 +ADw-ul+AD4 +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-arm32.md+ACIAPg.NET Core ARM32 Docker Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile.basic-preview+ACIAPg-sample+ADw-/a+AD4 builds and runs an application with Debian on ARM32 (works on Raspberry Pi). +ADw-li+AD4APA-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/README.md+ACIAPg-ASP.NET Core ARM32 Docker Sample+ADw-/a+AD4 - This +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile.preview+ACIAPg-sample+ADw-/a+AD4 builds and runs an ASP.NET Core application with Debian on ARM32 (works on Raspberry Pi).+ADw-/li+AD4APA-/ul+AD4 +ADw-p+AD4-I found +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/README.md+ACIAPg-the samples+ADw-/a+AD4 to be super useful...be sure to dig into the Dockerfiles themselves as it'll give you a ton of insight into how to structure your own files. Being able to do Multistage Dockerfiles is crucial when building on a small device like a RPi. You want to do as little work as possible and let Docker cache as many layers with its internal +ACI-smarts.+ACI If you're not thoughtful about this, you'll end up wasting 10x the time building image layers every build.+ADw-/p+AD4 +ADw-h3+AD4-Dockerizing a real ASP.NET Core Site with tests+ACEAPA-/h3+AD4 +ADw-p+AD4-Can I take my podcast site and Dockerize it and build/test/run it on a Raspberry Pi? YES.+ADw-/p+AD4APA-pre+AD4-FROM microsoft/dotnet:2.1-sdk AS build +ADw-br+AD4-WORKDIR /app +ADw-br+AD4 +ADw-br+AD4AIw copy csproj and restore as distinct layers +ADw-br+AD4-COPY +ACo.sln . +ADw-br+AD4-COPY hanselminutes.core/+ACo.csproj ./hanselminutes.core/ +ADw-br+AD4-COPY hanselminutes.core.tests/+ACo.csproj ./hanselminutes.core.tests/ +ADw-br+AD4-RUN dotnet restore +ADw-br+AD4 +ADw-br+AD4AIw copy everything else and build app +ADw-br+AD4-COPY . . +ADw-br+AD4-WORKDIR /app/hanselminutes.core +ADw-br+AD4-RUN dotnet build +ADw-br+AD4 +ADw-br+AD4 +ADw-br+AD4-FROM build AS testrunner +ADw-br+AD4-WORKDIR /app/hanselminutes.core.tests +ADw-br+AD4-ENTRYPOINT +AFsAIg-dotnet+ACI, +ACI-test+ACI, +ACI---logger:trx+ACIAXQ +ADw-br+AD4 +ADw-br+AD4 +ADw-br+AD4-FROM build AS test +ADw-br+AD4-WORKDIR /app/hanselminutes.core.tests +ADw-br+AD4-RUN dotnet test +ADw-br+AD4 +ADw-br+AD4 +ADw-br+AD4-FROM build AS publish +ADw-br+AD4-WORKDIR /app/hanselminutes.core +ADw-br+AD4-RUN dotnet publish -c Release -o out +ADw-br+AD4 +ADw-br+AD4 +ADw-br+AD4-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime +ADw-br+AD4-WORKDIR /app +ADw-br+AD4-COPY --from+AD0-publish /app/hanselminutes.core/out ./ +ADw-br+AD4-ENTRYPOINT +AFsAIg-dotnet+ACI, +ACI-hanselminutes.core.dll+ACIAXQA8-/pre+AD4 +ADw-p+AD4-Love it. Now I can +ACI-docker build .+ACI on my Raspberry Pi. It will restore, test, and build. If the tests fail, the Docker build will fail.+ADw-/p+AD4 +ADw-p+AD4-See how there's an extra section up there called +ACI-testrunner+ACI and then after it is +ACI-test?+ACI That testrunner section is a no-op. It sets an ENTRYPOINT but it is never used...yet. The ENTRYPOINT is an implicit run +ADw-em+AD4-if it is the last line in the Dockerfile. +ADw-/em+AD4-That's there so I can +ACI-Run up to it+ACI if I want to. +ADw-/p+AD4 +ADw-p+AD4-I can just build and run like this:+ADw-/p+AD4APA-pre+AD4-docker build -t podcast . +ADw-br+AD4-docker run --rm -it -p 8000:80 podcast+ADw-/pre+AD4 +ADw-blockquote+AD4 +ADw-p+AD4APA-strong+AD4-NOTE/GOTCHA:+ADw-/strong+AD4 Note that the +ACI-runtime+ACI image is microsoft/dotnet:2.1-aspnetcore-runtime, not microsoft/dotnet:2.1-runtime. That aspnetcore one pre-includes the binaries I need for running an ASP.NET app, that way I can just include a single reference to +ACIAJg-lt+ADs-PackageReference Include+AD0AIg-Microsoft.AspNetCore.App+ACI Version+AD0AIg-2.1.0-rc1-final+ACI /+ACY-gt+ADsAIg in my csproj. If didn't use the aspnetcore-runtime base image, I'd need to manually pull in all the ASP.NET Core packages that I want. Using the base image might make the resulting image files larger, but it's a balance between convenience and size. It's up to you. You can manually include just the packages you need, or pull in the +ACI-Microsoft.AspNetCore.App+ACI meta-package for convenience. My resulting +ACI-podcast+ACI image ended up 205megs, so not to bad, but of course if I wanted I could trim in a number of ways.+ADw-/p+AD4APA-/blockquote+AD4 +ADw-p+AD4-Or, if I JUST want +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/dotnet-docker-unit-testing.md+ACIAPg-test results from Docker+ADw-/a+AD4, I can do this+ACE That means I can run the tests in the Docker container, mount a volume between the Linux container and (theoretical) Window host, and then open the .trx resulting file in Visual Studio+ACEAPA-/p+AD4APA-pre+AD4-docker build --pull --target testrunner -t podcast:test . +ADw-br+AD4-docker run --rm -v D:+AFw-github+AFw-hanselminutes-core+AFw-TestResults:/app/hanselminutes.core.tests/TestResults podcast:test+ADw-/pre+AD4 +ADw-p+AD4-Check it out+ACE These are the test results from the tests that ran within the Linux Container:+ADw-/p+AD4 +ADw-p+AD4APA-img title+AD0AIg-XUnit Tests from within a Docker Container on Linux viewed within Visual Studio on Windows+ACI style+AD0AIg-border-left-width: 0px+ADs border-right-width: 0px+ADs background-image: none+ADs border-bottom-width: 0px+ADs padding-top: 0px+ADs padding-left: 0px+ADs display: inline+ADs padding-right: 0px+ADs border-top-width: 0px+ACI border+AD0AIg-0+ACI alt+AD0AIg-XUnit Tests from within a Docker Container on Linux viewed within Visual Studio on Windows+ACI src+AD0AIg-https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/67a54ca88e34+AF8-E5AC/image+AF8-83fcfc3d-250d-4c91-a499-47cd6c6bc238.png+ACI width+AD0AIg-615+ACI height+AD0AIg-545+ACIAPgA8-/p+AD4 +ADw-p+AD4-Here's the result. I've now got my Podcast website running in Docker on an ARM32 Raspberry Pi 3 with just an hours' work (writing the Dockerfile)+ACE +ADw-/p+AD4 +ADw-p+AD4APA-figure+AD4APA-img title+AD0AIg-It's my podcast site running under Docker on .NET Core 2.1 on a Raspberry Pi +ACI style+AD0AIg-border-left-width: 0px+ADs border-right-width: 0px+ADs background-image: none+ADs border-bottom-width: 0px+ADs padding-top: 0px+ADs padding-left: 0px+ADs display: inline+ADs padding-right: 0px+ADs border-top-width: 0px+ACI border+AD0AIg-0+ACI alt+AD0AIg-It's my podcast site running under Docker on .NET Core 2.1 on a Raspberry Pi +ACI src+AD0AIg-https://www.hanselman.com/blog/content/binary/Windows-Live-Writer/67a54ca88e34+AF8-E5AC/image+AF8-3442eb89-d1aa-4ac8-a065-cdc7b31dd44a.png+ACI width+AD0AIg-1001+ACI height+AD0AIg-623+ACIAPgA8-/figure+AD4 +ADw-/p+AD4 +ADw-p+AD4APA-strong+AD4-Second +ADw-/strong+AD4-- did you make it this far down? - You can just install the .NET Core 2.1 SDK +ACI-on the metal.+ACI No Docker, just get the tar.gz and set it up. +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://github.com/dotnet/dotnet-docker/blob/master/2.1/sdk/stretch/arm32v7/Dockerfile+ACIAPg-Looking at the RPi ARM32v7 Dockerfile+ADw-/a+AD4, I can install it on the metal like this:+ADw-/p+AD4APA-pre+AD4AJA sudo apt-get -y update +ADw-br+AD4AJA sudo apt-get -y install libunwind8 gettext +ADw-br+AD4AJA wget https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.300-rc1-008673/dotnet-sdk-2.1.300-rc1-008673-linux-arm.tar.gz +ADw-br+AD4AJA sudo mkdir /opt/dotnet +ADw-br+AD4AJA sudo tar -xvf dotnet-sdk-latest-linux-arm.tar.gz -C /opt/dotnet +ADw-br+AD4AJA sudo ln -s /opt/dotnet/dotnet /usr/local/bin +ADw-br+AD4AJA dotnet --info+ADw-/pre+AD4 +ADw-p+AD4-Cross-platform for the win+ACE +ADw-hr+AD4 +ADw-/p+AD4 +ADw-p+AD4APA-strong+AD4-Sponsor+ADw-/strong+AD4: Check out JetBrains Rider: a +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hnsl.mn/2GoDw4V+ACIAPg-cross-platform .NET IDE+ADw-/a+AD4. Edit, refactor, test and debug ASP.NET, .NET Framework, .NET Core, Xamarin or Unity applications. Learn more and +ADw-a href+AD0AIg-http://feeds.hanselman.com/+AH4-/t/0/0/scotthanselman/+AH4-https://hnsl.mn/2GoDw4V+ACIAPg-download a 30-day trial+ADw-/a+AD4AIQA8-/p+AD4 +ADw-br/+AD4APA-hr/+AD4AqQ 2018 Scott Hanselman. All rights reserved. +ADw-br/+AD4APA-/div+AD4APA-Img align+AD0AIg-left+ACI border+AD0AIg-0+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi style+AD0AIg-border:0+ADs-float:left+ADs-margin:0+ADs-padding:0+ADs-width:1px+ACE-important+ADs-height:1px+ACE-important+ADsAIg hspace+AD0AIg-0+ACI src+AD0AIg-http://feeds.hanselman.com/+AH4-/i/546237078/0/scotthanselman+ACIAPg +ADw-div style+AD0AIg-clear:both+ADs-padding-top:0.2em+ADsAIgA+ADw-a title+AD0AIg-Like on Facebook+ACI href+AD0AIg-http://feeds.hanselman.com/+AF8-/28/546237078/scotthanselman+ACIAPgA8-img height+AD0AIg-20+ACI src+AD0AIg-https://assets.feedblitz.com/i/fblike20.png+ACI style+AD0AIg-border:0+ADs-margin:0+ADs-padding:0+ADsAIgA+ADw-/a+AD4AJgAj-160+ADsAPA-a title+AD0AIg-Share on Google+ACsAIg href+AD0AIg-http://feeds.hanselman.com/+AF8-/30/546237078/scotthanselman+ACIAPgA8-img height+AD0AIg-20+ACI src+AD0AIg-https://assets.feedblitz.com/i/googleplus20.png+ACI style+AD0AIg-border:0+ADs-margin:0+ADs-padding:0+ADsAIgA+ADw-/a+AD4AJgAj-160+ADsAPA-a title+AD0AIg-Tweet This+ACI href+AD0AIg-http://feeds.hanselman.com/+AF8-/24/546237078/scotthanselman+ACIAPgA8-img height+AD0AIg-20+ACI src+AD0AIg-https://assets.feedblitz.com/i/twitter20.png+ACI style+AD0AIg-border:0+ADs-margin:0+ADs-padding:0+ADsAIgA+ADw-/a+AD4AJgAj-160+ADsAPA-a title+AD0AIg-Subscribe by email+ACI href+AD0AIg-http://feeds.hanselman.com/+AF8-/19/546237078/scotthanselman+ACIAPgA8-img height+AD0AIg-20+ACI src+AD0AIg-https://assets.feedblitz.com/i/email20.png+ACI style+AD0AIg-border:0+ADs-margin:0+ADs-padding:0+ADsAIgA+ADw-/a+AD4AJgAj-160+ADsAPA-a title+AD0AIg-Subscribe by RSS+ACI href+AD0AIg-http://feeds.hanselman.com/+AF8-/20/546237078/scotthanselman+ACIAPgA8-img height+AD0AIg-20+ACI src+AD0AIg-https://assets.feedblitz.com/i/rss20.png+ACI style+AD0AIg-border:0+ADs-margin:0+ADs-padding:0+ADsAIgA+ADw-/a+AD4AJgAj-160+ADsAPA-/div+AD4