randy3k/shiny-cloudrun-demo

Issue running as non-root in GCP

Closed this issue · 4 comments

Hi @randy3k ,

Thanks very much for the template!
We're trying to use this to host our shiny dashboard via GCP Cloud Run. Unfortunately, when trying to run your example, our dashboard or even the base rocker image with a non-root user we get a permission error when starting an instance:
s6-mkdir: warning: unable to mkdir /var/run/s6: Permission denied

Searching for other examples of this suggests that initialisation of S6 requires root. However, your example and the rocker documentation suggest that running as user shiny should work fine.

We're able to run any of them as root, but this is obviously not ideal for security. We'd be really grateful if you have any suggestions as to why this might be occurring.

It is because your particular container requires S6. Do you really need S6?

Sorry, I thought that the S6 init was being triggered by rocker - there's no reason for us to use S6 and I'm not sure where we've selected to use a container that requires it. What would be a suitable alternative for a simple shiny app? And where is this configured?

I pulled the latest rocker/shiny and I could reproduce the error. See this rocker-org/shiny#79

A suggested solution to add

CMD ["/usr/bin/shiny-server"]

to Dockerfile.

Thanks very much for taking a look and finding the related issue. This solution worked 👍