rien / reStream

Stream your reMarkable screen over SSH.
MIT License
748 stars 57 forks source link

Add docker support #76

Closed larsblumberg closed 2 years ago

larsblumberg commented 3 years ago

This MR adds support for running reStream within a Docker container so that the prerequisites don't need to be installed on the host system.

Windows and macOS need to install an X server compatibility layer while Unix-like OSes have the X system already installed.

The readme file is updated to document the docker usage.

Eeems commented 3 years ago

The rational here feels off to me. Avoid having to install dependencies by now having to install more dependencies?

I think it would make more sense to package this up as an appimage on linux, and some other self contained solution for mac/windows.

larsblumberg commented 3 years ago

On Linux, the only dependency required is docker, that's it. As a developer I prefer not installing dependencies on my host but instead keep the requirements containerized.

Eeems commented 3 years ago

On Linux, the only dependency required is docker, that's it. As a developer I prefer not installing dependencies on my host but instead keep the requirements containerized.

Right, but you mentioned Windows and MacOS in your original message. They require docker as well as X servers to be installed.

I still think that appimage for linux would be a better solution for most end users. Especially since a large chunk of them are not developers and would not want to install/learn docker for this.

Myridium commented 2 years ago

The idea of dockerisation is less removing dependencies, and more about making software portable, reproducible, and transient in the sense that they do not clutter up the host system. (Ironically Docker itself loves to clutter the system with large images and containers by default).

This is one of those things where the benefit comes from the network effect-- if everyone accepts docker, then tons of software can be run without additional dependencies.

Myridium commented 2 years ago

However dockerisation of a software stack does result in pulling the same but slightly different images again and again, using far more disk space than is reasonable for an application. There is always a tradeoff between portability and efficiency.

If everyone uses a common software stack and agrees to maintain compatibility with official repositories as they update, then programs share dependencies and it's more (space) efficient. This is facilitated by a package manager.

The other end is Docker and AppImages. They result in terribly bloated images as they package all dependencies. However at least Docker is open source, and in principle can reuse images requested by multiple containers, though it doesn't work that way in practice. E.g. I don't think it can reuse alpine packages.

A solution is for users to store diffs between software versions (a la git, open source) and run software against the versions they need. Now if anyone knows of a solution like that, let me know.

rien commented 2 years ago

@Myridium have you tried NixOS? It does exactly like you describe docker to do: make software portable and reproducible while maximizing the amount of shared dependencies when needed and/or desired. In practice the resulting systems can be a bit space-hungry, especially if you like to keep a few generations of your system. But space is not the issue it used to be before and the ability to reliably roll back to previous versions is heaven.

If you're curious, you can find my configuration here: https://github.com/rien/nixos-config.

rien commented 2 years ago

I will close this PR though. While I don't have anything against docker, I think it is not useful to create one for a single script. I think that users who prefer running things sandboxed in docker will also be capable of writing the dockerfiles themselves and might even prefer it that way.

I do appreciate that you want to contribute to this project @larsblumberg. Thank you.

Myridium commented 2 years ago

@rien Thanks, I'll look into that once I find the time.