Unit in Docker as random user

Tobias Genannt tobias.genannt at kappa-velorum.net
Tue Nov 10 07:47:08 UTC 2020


I'm having some trouble with running unit in a Docker container as an 
unprivileged (random) user. The image will run in Openshift later, 
that's why I have a random user. In my Docker file I have the following:

RUN mkdir -p /opt/unit/state/ /opt/unit/tmp/ && chmod -R a+w /opt/unit/
CMD ["unitd", "--no-daemon", "--control", "*:7777", "--pid", 
"/opt/unit/unit.pid", "--state", "/opt/unit/state/", "--tmp", 
"/opt/unit/tmp/", "--log", "-"]

When I run the image I get the following output:
2020/11/10 07:31:08 [warn] 1#1 Unit is running unprivileged, then it 
cannot use arbitrary user and group.
2020/11/10 07:31:08 [info] 1#1 unit started
2020/11/10 07:31:08 [alert] 1#1 unlink("/opt/unit/unit.pid") failed (2: 
No such file or directory)

There are no error, unitd just quit with exit code 1. What am I doing 
wrong here and how do I get some more information out of the process to 
find the error?

Kind regards,

More information about the unit mailing list