How to do gracefully shutdown on dotnet with docker?
Using 2.0.0-preview2-006497 I did some testing, and now the AssemblyLoadContext.Default.Unloading is fired when Docker sends a SIGTERM/SIGINT to the container.
Example code looks like:
System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += ctx =>{ // code here...};
See also this issue for some details: https://github.com/aspnet/Hosting/issues/870