~alpine/users

init script for dockerd-rootless

Janik Besendorf | Reporter Ohne Grenzen <janik.besendorf@reporter-ohne-grenzen.de>
Details
Message ID
<537cf6e5-2637-4bac-b6ef-c23afa8f90e6@reporter-ohne-grenzen.de>
DKIM signature
missing
Download raw message
Hi,

I want to setup docker rootless on alpine. The wiki mentions docker 
rootless (https://wiki.alpinelinux.org/wiki/Docker) and also explains 
how to configure it. However no OpenRC init script is provided to 
automatically start dockerd-rootless as a user.

OpenRC offers several options to run services as a user 
(https://wiki.gentoo.org/wiki/OpenRC/User_services) However they don't 
seem to fit the use case of running dockerd-rootles. For example the 
first method that uses supervise-daemon does not allow the procces to 
fork which is required for dockerd. The second one using pam only works 
when a session of that user is active. That is also not what I want. I 
want to run the service at boot.

I think the best way would be to modify the docker.initd included with 
the docker package 
(https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/docker/docker.initd?ref_type=heads) 
and drop privileges. Maybe using su or runuser?

I am not really familiar with OpenRC init scripts. Could someone help me 
out with this?

thank you very much.

Janik
Reply to thread Export thread (mbox)