Userns-remap with useradd during build

Hi all,
userns-remap is set up like this
host_user:1000:1
host_user:100000:65536

And in my Dokerfile(which based on ubuntu:bionic) there is a line, which creates a new user
RUN useradd -m container_user
So UID of container_user inside of the container is 1000.

Since the user was created, owner of container_user’s home directory is root. And I do not understand why.
root@8cb31067da78:/home/container_use# ll
total 24
drwxr-xr-x 1 root root 4096 Sep 23 08:27 ./
drwxr-xr-x 1 root root 4096 Sep 23 08:27 …/
-rw-r–r-- 1 root root 220 Apr 4 2018 .bash_logout
-rw-r–r-- 1 root root 3771 Apr 4 2018 .bashrc
-rw-r–r-- 1 root root 807 Apr 4 2018 .profile

If I remove first line in /etc/subuid, or make the range from 1001, it starts working as I expecting(at least, owner of /home/container_user (inside of the container) become the container_user.
Could someone explain, why owner of /home/container_user is root when UID of the container_user is 1000? :slight_smile: