4 ms·
I recently saw SQLite used (and written to) in a Docker container, with the database file on a mounted volume. That made me nervous! I don't know enough about
by davepeck 4y ago
I recently saw SQLite used (and written to) in a Docker container, with the database file on a mounted volume.
That made me nervous!
I don't know enough about how Docker implements volumes under the hood to know how likely (or not) it is to break filesystem behavior that SQLite depends on for its transactional guarantees.
Perhaps someone here does?
- ktaylora 4y agoI've used mounted volumes in docker for high-traffic postgresql databases and they've held up nicely. Should test this with SQLite, but I imagine it would perform just fine.
- rfoo 4y agoVolumes are implemented with bind mount and it breaks almost nothing. No need to be nervous.
- andix 4y agoAs long as you’re not using docker for windows you should be fine. Docker desktop for windows uses a network share, to connect the Windows filesystems to the Linux docker system. Volumes are made exactly for holding databases. And also bind mounts should work without any issue in most configurations. But if there is some kind of network/virtualization between the physical disk and the container, you should investigate it in more detail.
- Too 4y agoHalf of the universe nowadays run on containers with volume mounts. No need to be worried about it being a container per se. What you should worry about though is the underlying volume driver and its storage type. Volumes can be simple bind mounts to your local disk, being more or less identical to no container. But volumes can also be attached straight to a network disk, where same dangers apply as if you would have mounted that network disk on host.