For example, a service was written in python.
Is the running user root?
If so, is there any potential safety hazard?
The running user can write in Dockerfile. The default is root.
Of course, there are security risks when using root. docker’s best practices recommend running applications with ordinary users (non-root).