3 ms·
Posted in another thread... but I discovered how the FS in Docker for (Windows/Mac) worked the hard way. If you use a mounted volume in Win/Mac it does a synci
by tracker1 7y ago
Posted in another thread... but I discovered how the FS in Docker for (Windows/Mac) worked the hard way. If you use a mounted volume in Win/Mac it does a syncing, not a direct mount/share. This lags and isn't a great option for live databases and if you're accessing the same SQLite db outside the container and inside, you will see corruption happen.
In any case, it was definitely an interesting discovery... since then, I only use shared volumes with the host as backup/restore targets, never for shared anything.
- zeeZ 7y agoI run Plex on my Windows desktop as a container, with everything I want to persist mounted in (this includes the database). If I don't stop the container before hibernating my PC, I'm pretty much guaranteed to have some kind of database corruption on the next start.
- tracker1 7y agoI'd consider a volume container for your database, the content is probably safe enough, since it's not a lot of heavy write. Then have a timed event that copies the DB out of the volume container for backups regularly.
- tracker1 7y agoIt's also worth noting, that using a DB in a shared volume, even if you don't touch it outside the container, is MUCH slower... I was doing this for mssql containers and when I stopped, my spinup for a fresh instance went from nearly 90 seconds to about 15.