Dropping user privileges when running docker

Hi, I’m using the docker setup. However I can’t make it work with a non-root user.

If I try to ./launcher rebuild app as non-root I get:

WARNING: Error loading config file: /root/.docker/config.json: stat /root/.docker/config.json: permission denied

Running as root, I get a working setup but obviously I don’t want to run something facing the internet as root.

How to fix this issue cleanly?

What is your setup? We don’t reference config.json anywhere explicitly in discourse_docker, so presumably that’s coming from something you’ve done.

To address your larger question, that ./launcher is run as root does not imply that Discourse itself runs as root.

3 Likes

so you confirm running the builder/launcher as root is safe?

I never confirm anything is safe. Caveat Executor at all times.

1 Like

How do you recommend to run the docker then? I’m used to dockers that let you set an PUID and PGID…or am I the only person having issues running the builder as non-root user?