Problem statement: Cygwin in a Docker container cannot unlink(2) files and/or directories, that are mounted from the host file system, no matter if those files/directories where created by Cygwin commands or where already there before. Anything that runs unlink(2) like rm(1), rmdir(1), cp(1), mv(1), find ... -delete, ... comes back with Invalid argument Cygwin can create files/directories in mounted directories. I have tested Cygwin 3.0.4, 3.0.7, 3.1.4 in 64 bit and 1.7.17 and 3.1.4 in 32 bit. Only in Cygwin 1.7.17 32 bit the unlink(2) system call equivalent worked on mounted volumes. Reproduction scenario: On the host (Microsoft Windows [Version 10.0.17763.1039]) create a directory to be mounted in the container. C:\> mkdir c:\cwmount If you don't have a Docker image, then pick something like https://hub.docker.com/r/rkttu/cygwin The next command starts a Docker container and mounts the host directory c:\cwmount as c:\cwmount in the running container. C:\> docker run -it -v c:\cwmount:c:\cwmount rkttu/cygwin:3.0.4-1809-core # Now we are in the running container, which comes up with a bash(1). $ uname -a CYGWIN_NT-10.0 7e390383568d 3.0.4(0.338/5/3) 2019-03-16 09:50 x86_64 Cygwin ContainerAdministrator@7e390383568d / $ cd /cygdrive/c/cwmount/ ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ touch afile ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ ls -la total 4 d---rwx---+ 1 Unknown+User Unknown+Group 0 Mar 11 23:39 . drwxrwx---+ 1 Administrators SYSTEM 0 Mar 11 23:37 .. ----rwx---+ 1 Unknown+User Unknown+Group 0 Mar 11 23:39 afile # In a filesystem mounted in a container I can create files, but not unlink(2) them ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ rm afile rm: cannot remove 'afile': Invalid argument ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ ls -la total 4 d---rwx---+ 1 Unknown+User Unknown+Group 0 Mar 11 23:39 . drwxrwx---+ 1 Administrators SYSTEM 0 Mar 11 23:37 .. ----rwx---+ 1 Unknown+User Unknown+Group 0 Mar 11 23:39 afile ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ unlink afile unlink: cannot unlink 'afile': Invalid argument ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ strace -f -o unlink-error.log unlink afile unlink: cannot unlink 'afile': Invalid argument ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ ls -l unlink-error.log ----rwx---+ 1 Unknown+User Unknown+Group 75513 Mar 11 23:41 unlink-error.log ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ cd / ContainerAdministrator@7e390383568d / $ touch afile # In the container's native filesystem unlink works ContainerAdministrator@7e390383568d / $ rm afile ContainerAdministrator@7e390383568d / $ touch afile ContainerAdministrator@7e390383568d / $ strace -f -o unlink-success.log unlink afile ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ uname -a CYGWIN_NT-10.0 7e390383568d 3.0.4(0.338/5/3) 2019-03-16 09:50 x86_64 Cygwin ContainerAdministrator@7e390383568d /cygdrive/c/cwmount $ cygcheck -s -v -r > cygcheck-3.0.4.out On an old 32 bit version unlink(2) works. This is in my private Docker container. C:\dev_asw>C:\Programs\cygwin32\bin\bash 1 [main] bash 924 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to the public mailing list cygwin@cygwin.com $ uname -a CYGWIN_NT-6.2-WOW64 121084bc33fb 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin # Now I am in a mounted directory. ContainerAdministrator@121084bc33fb /cygdrive/c/dev_asw/logs $ touch afile ContainerAdministrator@121084bc33fb /cygdrive/c/dev_asw/logs $ ls -l afile ----------+ 1 ???????? ???????? 0 Mar 12 08:55 afile ContainerAdministrator@121084bc33fb /cygdrive/c/dev_asw/logs $ strace -f -o unlink-success.1.7.17.log unlink afile 11846 [main] unlink 536 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to the public mailing list cygwin@cygwin.com ContainerAdministrator@121084bc33fb /cygdrive/c/dev_asw/logs $ ls -l afile ls: cannot access afile: No such file or directory ContainerAdministrator@121084bc33fb /cygdrive/c/dev_asw/logs $ cygcheck -s -v -r > cygcheck-1.7.17.out Attached files: unlink-error.log strace of a failed unlink(1) of a previously created file in a mounted directory unlink-success.log strace of a successfull unlink(1) of a previously created file in a container-native directory cygcheck-3.0.4.out cygcheck from Cygwin 3.0.4 64, which has the unlink(2) problem cygcheck-1.7.17.out cygcheck from Cygwin 1.7.17 32 where unlink(2) works -- Pawel Nabe PaN Super Sonic Software Service expert in hi tech & low budget