I have a simple Dockerfile:
FROM mcr.microsoft.com/windows:1809
# Install chocolatey
RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [S
It seems that it is hardlinks which Cygwin uses a lot are not handled correctly by Docker. And in particular when Docker tries to commit an image it fails with "hcsshim::ImportLayer - cannot find the path" error.
I run in the same problem recently and after I got rid of the hardlinks in Cygwin installation I was able to commit the image without problems.
To get rid of the hardlinks I have zipped and unzipped Cygwin folder.