Activitywatch: Dockerize application

Created on 23 Jan 2018  路  5Comments  路  Source: ActivityWatch/activitywatch

I think it would be quite useful to dockerize application to enable users or developers to run it easier- at least in qt-less mode. Steps needed to do it:

  • [ ] create dockerfiles in all relevant subrepos
  • [ ] setup automated builds of images in CI
  • [ ] create docker-compose.yml file in main repo
  • [ ] [Optional] setup running tests on top of docker

What's your opinion on this? If you agree I could try to make some PoC and follow up with it.

question

Most helpful comment

I feel like this might help some people so I'm just gonna leave it here: docker-activitywatch.

All 5 comments

The watchers need direct access to OS/Xorg functions, so the only activitywatch component which could actually run within docker and still be useful would be aw-server. We do have mongodb support which could be nicely set-up with docker automatically but as far as I am aware noone is actually using that and since the default database is sqlite I'm not sure how many people would actually care about setting it up in docker.

On the other hand when talking about containerizing, flatpak/snap/appimage support would be really nice since both aw-server and the watchers could run on that, but that would not be for development but for being more stable across distros when packaging all the executables in the releases.

Can you please point me to some example of direct OS/xorg functions used? Afaik it should be doable to use most of OS functionalities from within docker container.
Whole idea was born in my head because I'd like to just run server+watchers in single command and docker-compose seem to be a good fit for that. Flatpak/snap/appimage indeed seem to be a way to go for packaging but I don't have any experience with it.

@mrbox Someone else tried this before but came to the same conclusion as the one @johan-bjareholt mentioned: https://github.com/ActivityWatch/activitywatch/issues/138

  • aw-watcher-afk needs access to the OS to get time since last input (which in turn is used to infer (non-)AFK state), which on Linux is a HID-hook that cannot (afaik) be set up from Docker (without a lot of ugly hacks).
  • aw-watcher-window needs access to the display server to ask which the active window is.

In addition to that, Docker is simply not designed for end-user applications and I can't see any significant value in supporting or maintaining support for it at this time.

Flatpak/Snap/AppImage is a much more fitting approach that's actually designed for end-users (while Docker is exclusively useful for developers), but we'd rather focus on other stuff at the moment.

Closing due to inactivity.

I feel like this might help some people so I'm just gonna leave it here: docker-activitywatch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bawasi picture bawasi  路  8Comments

ErikBjare picture ErikBjare  路  10Comments

xylix picture xylix  路  6Comments

awesomehaze picture awesomehaze  路  9Comments

pahofmann picture pahofmann  路  10Comments