UID in docker and host are different

Hello,

Maybe someone make clear for me. Is there dependency of users (UID) from host and container?

I have the running nginx with 101 UID=nginx on the container.

But host has another user for this UID 101=syslog. And top on host show that the running nginx from syslog

container:
root@c11b2741a274:/# cat /etc/passwd | grep 101
nginx:x:101:101:nginx user,:/nonexistent:/bin/false

host:
root@docker-01:/home/docker# cat /etc/passwd | grep 101
syslog:x:101:104::/home/syslog:/bin/false

top
2066 syslog 20 0 2097272 1.775g 1936 S 0.3 15.1 3:16.27 nginx-debug

The view of owner procees is wrong,. Is this only incorrect view.

  • Is it has the influence on the process? For example system limits for users, etc.
  • What is the best practice for the creating users with docker?

System:
Ubuntu 14.04.5 LTS (3.16)
Docker version 17.09.0-ce