benbjohnson/litestream.io

Question regarding OS compatibility in docker documentation

Closed this issue · 4 comments

Hello,

first thank you for the project. We are just starting to try it out and it works amazingly well.

We have one clarifying question regarding the docker documentation. In the first paragraph is a warning regarding running different OS in the container and the host.

Does this apply to the sidecar scenario only or does it also apply to running litestream in the same docker container as our own application?

From the placement in the docs it looks like it applies to everything. From our understanding of the underlying technology it should only apply to the sidecar scenario.

Which one is correct?

Thank you

hifi commented

It applies to all scenarios where Litestream and the SQLite database could be accessed across operating system boundaries.

Usually on Docker you'd run both the application and Litestream as containers so they would likely be running on the same operating system on top of the container runtime.

So if the application runs on Linux, Litestream must also run on Linux. If application runs on macOS, Litestream must also run on macOS.

When running as a sidecar it's impossible to use different operating systems as they'd both be running within the same Linux namespace anyway.

Hello,

thanks for the quick response and explanation.

So, just to reiterate, if we run litestream in the same docker container as our app and we only have one instance of the container running at the same time and have the sqlite db local in the container somewhere we are fine?!

Thanks :)

hifi commented

Yes, that should be perfectly fine. You could also consider using litestream exec to run both in the same container where Litestream will start your application as a sub-process so Litestream can always start first and exit last.

Yep, this is what we are using.

Thank you very much for the quick help!