Docker containers are always run as root  user by default. As a result all running processes, shared volumes, folders, files will be owned by root  user. It becomes real problem when we need to modify files and folder in shared folders within host OS or docker container.

In order to solve such issue, we need to match host OS and docker container user’s UID s. The root  user’s UID  is always 0 . Running docker as root  user is also considered as a bad security practice.

#docker #container #dockerfile

Running Docker Container with A Non-root User
1.30 GEEK