July 31, 2019

Running docker container as www-data (non-root) with dotnet core

It is best practice to run docker containers as a non-root user. You can either add your own user with group, home etc. You can alos use the existing www-data user if you wish. It makes it trivial to run a Docker container as non-root.

Here is an example of a docker file for running a non-root container with Docker.

There you go, super simple.