I'm basically trying to run crond -f
as root, while having the default user be something different.
Since the crontabs it runs use sensitive information from other files on the image, I want to give root access to these files, start the crond process, then switch the user to a newly created one. This way the cronjobs will be able to get the information they need, while securing the sensitive files in the container from anyone who may get exec access.
have tried a couple things like this:
USER root
CMD ["./runCrons.sh"]
USER newuser
But this does not run the crond process as root, but as newuser.
If anyone has a solution it would save me some digging and experimentation.