Kestrel webserver (server which serves ASP.NET core exe) does not support integrated Windows authentication and requires external proxy server to handle this. One of the those proxy servers is IIS. Problem is that there is no docker image provided by Microsoft which have IIS + ASP.NET core + nanoserver. Further complicating things are the fact that there is no easy and straightforward way to install IIS on nanoserver image which has ASP.NET core, neither it’s easy to install ASP.NET core on IIS image build on nanoserver. There is multitude articles and script which are doing little parts here and there but none provide complete solution in part due to requirement to have ASP.NET core module to be first installed on full server core image before DLLs can be extracted for use in nanoserver IIS image.
Thanks to 17.05 docker options to build multistage image this entire pretty easily accomplished with single docker file.
Dockerfile below is using 2 middleware images to pull relevant files into final image which contains ASP.NET core + IIS on top of nanoserver.
microsoft/aspnetcore:2.0.0-nanoserver is used for extraction of .NET core installation.
microsoft\iis based off WindowsServerCore is used to install .NET core webhosting package (EXE which upon execution places required ASP.NET core module and schema into middleware container) and later extract 2 necessary files (module itself and schema file) to be used in final image.
Final image is built from 2 middleware images above with some additional configuration necessary for ASP.NET core module to work in IIS and path to DOTNET core is added to environment