green-metrics-tool icon indicating copy to clipboard operation
green-metrics-tool copied to clipboard

Please support docker root mode

Open schlichtanders opened this issue 2 years ago • 4 comments

I just wanted to try out green-metrics-tool, however it requires docker root-less mode. I would need to setup another user on my laptop and configure that one, which is impressively complicated. My vision was to try out green-metrics-tool, spend 3 hours, and having something working.

As the documentation does not name a crucial reason why root docker is not supported (yet), I guess it is at least possible to support it.

Having docker root support is of course a kind of XY problem - the final problem is to have an easy way to install green-metrics-tool as a package on your system, so that you can try out green-metrics-tool within 1 hour or something.

schlichtanders avatar Mar 24 '23 08:03 schlichtanders

Hey @schlichtanders ,

thanks for the issue!

Can you detail the problems that you had with enabling docker rootless mode? Did you spot the part in the documentation that had an explanation about it?

Generally if you are on a classic laptop setup your normal login user is already a non-root user (since your are not "root" I guess in your normal terminal), so creating a user is not necessary.

Maybe the documentation is too confusing here and we are super happy you bring the case up. The goal is exactly what you mention: A setup time of less then 10 minutes even is what we target.

The reason why docker rootless is not supported lies in the fact that our reporters have to work differntly when targeting a rootless orchestration than a "rootful" one. Systemd saves data in different places and also forwarding is setup in a different place. Just so you have a reason why we choose to only support one mode. The benefit we get from Docker rootless mode is an increased security as we run the same code on our servers that we document for a "home / dev" setup.

As said: I would like to get your feedback on my question above and then help you getting it set up.

ArneTR avatar Mar 24 '23 10:03 ArneTR

Also a follow up question to you: Do you have for instance also podman installed on your system or ever worked with it? We had the discussion internally to circumevent the Docker rootless mode setup by using a different orchestrator that might be easiert for devs to interact with ...

ArneTR avatar Mar 24 '23 10:03 ArneTR

Thank you for your elaborate answer. I am using docker, mainly because back then I was not even aware of podman or else. It may actually be simple to also use docker in rootless mode, it is just that I am using docker on a daily basis and hence I am afraid, tinkering with it may destroy my working setup.

Hence I read the install documentation mainly from the perspective that I would like to have some package-like installer, which won't interfere with my custom tooling. I am working on NixOS, one of these OS which have excellent support for sandboxes, however I was not able to figure out on the fly how to sandbox your installation instructions.

Unfortunately I haven't found time to further understand which consequences it implies to have rootless docker (and how long it would take to make it work). I hope I find time to come back to this issue by end of May latest.

schlichtanders avatar Mar 28 '23 19:03 schlichtanders

Hey @schlichtanders

I just have found this issue in a 2024 housekeeping session. We actually implemented docker root mode a while ago: https://github.com/green-coding-berlin/green-metrics-tool/pull/488

Are you interested in giving the tool another spin? :)

ArneTR avatar Jan 04 '24 16:01 ArneTR

Since no update came on this Issue we close it. Has been implemented

ArneTR avatar May 22 '24 09:05 ArneTR