Database file is reported as locked, because CIFS requested a lock.
Volumes from Windows drives are mounted using CIFS on the linux side. If you try to use a database file over the SMB (running Linux, using share on Windows) without Docker it will behave the same.
I’ve found a workaround (solution?):
You need to edit Docker’s PowerShell script that starts the Docker VM.
It can be found here: C:\Program Files\Docker\Docker\resources\MobyLinux.ps1
You need to change the mounting parameters in the “Mount-Volume” function.
“noperm,iocharset=utf8” to “noperm,iocharset=utf8,nobrl”, in both lines (258, 261).
After a restart of Docker for Windows everything works as expected.
I opened an issue this weekend, hoping on a comment soon.
I’ve been digging around but found no other way to manually set the mounting params so at the moment i’m completely stuck.
I’ve several images that make use of sqlite where I would like to keep the db file accessible (non for concurrent use, just for backup/safety) and all of them are unusable.
The only, semi-coherent, workaround I can think of for now is to copy the database from the mount to a local docker folder on ENTRYPOINT and then sync it back using inotifywait wrapper, like this: https://github.com/hollow/inosync