You could write a script that just restarts your container, make sure unprivileged users cannot edit it, and do one of two things:
- make a sudoers entry for your unprivileged account to call just that script as a user in the docker group with sudo
- use setuid on the script to have it execute from the docker group even when executed by users
In a professional setting, sometimes the cost of developing something more performant in C is not worth it. The velocity unlocked by creating systems in Go is just incredible, after your company has built everything in C[++] for decades. I find myself creating gRPC APIs in Go to solve most design challenges, because it’s stupid fast to develop and is fairly maintainable after.