nestybox / sysbox

An open-source, next-generation "runc" that empowers rootless containers to run workloads such as Systemd, Docker, Kubernetes, just like VMs.
Apache License 2.0
2.62k stars 146 forks source link

Error in supervisord.conf of jenkins exemplary docker file #786

Open sebastian-peter opened 3 months ago

sebastian-peter commented 3 months ago

While using the exemplary Dockerfile for Jenkins, I came across something that looks like an error in supervisord.conf.

The jenkins process is configured with username=jenkins, but I think it should be user=jenkins. This could save the next person some time.

According to supervisord.conf documentation:

username belongs to configuration of [unix_http_server], which is not what we're doing here.

user on the other hand: Instruct supervisord to use this UNIX user account as the account which runs the program. The user can only be switched if supervisord is run as the root user. If supervisord can’t switch to the specified user, the program will not be started.

ctalledo commented 3 months ago

Thanks @sebastian-peter for catching this.

This means that supervisor.conf must have ignored username and therefore run Jenkins as root inside the Sysbox container (which is fine since it's root in the user-namespace of the container only, not on the underlying host machine). Nonetheless it's better to fix it to user=jenkins. I'll open a PR soon. Thanks!

BTW, were you able to verify things work with user=jenkins?

sebastian-peter commented 3 months ago

I'm using a slightly different Dockerfile, so it's hard to be 100% certain. One more thing that is missing (once Jenkins is not ran by root anymore) is providing the jenkins user with the rights to use docker. Thus I added a line RUN usermod -aG docker jenkins to the Dockerfile.