Open nickwesselman opened 4 years ago
This appears to be due to the fact that dotnet watch
requires taskkill
, which is not on the nanoserver base images. See StefanScherer/dockerfiles-windows#285.
Somewhat heavy workaround is to create a custom SDK image based on servercore.
Another scenario that would benefit from having supported .NET Core servercore based images - https://github.com/dotnet/dotnet-docker/issues/1852
Moved to aspnetcore since this is a general issue with dotnet watch
not supporting Nano Server.
To save others who may attempt the same, I tried adding taskkill.exe
to nanoserver, but it must have other dependencies, as it does not seem to execute.
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as servercore
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
COPY --from=servercore ["C:\\windows\\system32\\taskkill.exe", "C:\\windows\\system32\\"]
docker build . -t dotnetwatchnano
docker run --rm -it -p 8000:80 -v c:\dev\dotnet-docker\samples\aspnetapp:c:\app\ -w \app\aspnetapp -e ASPNETCORE_URLS=http://*:80 --name aspnetappsample dotnetwatchnano dotnet watch run --no-launch-profil
Microsoft Windows [Version 10.0.18363.836]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\app\aspnetapp>taskkill
C:\app\aspnetapp>taskkill
C:\app\aspnetapp>taskkill /?
C:\app\aspnetapp>
Thanks for contacting us.
We're moving this issue to the Next sprint planning
milestone for future evaluation / consideration. We will evaluate the request when we will planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
Please consider for .NET 6, if not sooner. We are heavily investing in Docker and ASP.NET Core, and dotnet watch is a great way for Sitecore devs to speed up developer iterations in our container environments:
In .NET 5 it's much easier to work around this as there are now Server Core containers available. πππ
dotnet/dotnet-docker#2377
Steps to reproduce the issue
dotnet-docker
repositorydocker run --rm -it -p 8000:80 -v c:\dev\dotnet-docker\samples\aspnetapp:c:\app\ -w \app\aspnetapp -e ASPNETCORE_URLS=http://*:80 --name aspnetappsample mcr.microsoft.com/dotnet/core/sdk:3.1 dotnet watch run --no-launch-profile
samples\aspnetapp\aspnetapp\Pages\Index.cshtml
and saveExpected behavior
Index.cshtml
Actual behavior
Output with
-v
does indicate that the polling file watcher is enabled, and that the change is seen, but thedotnet
process can't be stoppped.Additional information (e.g. issue happens only occasionally)
This seems to work fine with Linux Containers:
Output of
docker version
Output of
docker info