Running Sorry Cypress Dashboard as non-root user
Thanks to @mathpaquette for contributing this guide
Standard Nginx docker image requires privileged user to in order run properly, i.e. your user needs to be added to default docker group. On the other hand, in some corporate networks, docker engine has been configured to run under non-root user which requires additional steps to setup.

Getting config files

First you need to start sorry-cypress dashboard image to extract default configuration files.
1
docker run -it --user <name|uid>[:<group|gid>] --name dashboard agoldis/sorry-cypress-dashboard:latest /bin/sh
Copied!
Then you need to copy 2 configuration files from running container to your host. Open a new terminal without terminating the previous one.
1
docker cp dashboard:/etc/nginx/nginx.conf .
2
docker cp dashboard:/etc/nginx/templates/default.conf.template default.conf
Copied!
Now you can remove the current running container.
1
docker rm dashboard -f
Copied!

Adjusting config files

Now it's time to tweak a little bit config files from default image.

nginx.conf

1. Comment out the user directive:
1
#user nginx
Copied!
2. Replace all directives that point to /var/* to /tmp instead:
1
error_log /tmp/error.log warn;
2
pid /tmp/nginx.pid;
3
4
access_log /tmp/access.log main;
Copied!
3. Add these directives in http section:
1
http {
2
client_body_temp_path /tmp/client_temp;
3
proxy_temp_path /tmp/proxy_temp_path;
4
fastcgi_temp_path /tmp/fastcgi_temp;
5
uwsgi_temp_path /tmp/uwsgi_temp;
6
scgi_temp_path /tmp/scgi_temp;
7
}
Copied!
default.config
You just need to replace all ${} string patterns to your matching environment variables. Example:
Before
listen ${PORT} default_server;
After
listen 8080 default_server;
Make sure you choose a port > 1024 to be bindable from a non-root user.

Copying config files

Now, let's create a new container with default entry point. Don't worry, initial boot will fail.
1
docker run -it --user <name|uid>[:<group|gid>] --name dashboard agoldis/sorry-cypress-dashboard:latest
Copied!
Then, copy updated config files:
1
docker cp nginx.conf dashboard:/etc/nginx
2
docker cp default.conf dashboard:/etc/nginx/conf.d
Copied!

Running updated container

Now, you can run sorry-cypress dashboard under unprivileged user, simply but doing:
1
docker start dashboard
Copied!
You're done!