fluentd-docker-image icon indicating copy to clipboard operation
fluentd-docker-image copied to clipboard

Fluent user's homedir missing in debian based images

Open sbocinec opened this issue 4 years ago • 0 comments

Hey fluentd-docker-image maintaners!

I've noticed that debian based fluentd images (debian & armhf) do not have the fluent homedir created:

$ docker run -it --rm fluent/fluentd:v1.6.2-debian-1.0 sh
$grep fluent /etc/passwd
fluent:x:999:999::/home/fluent:
$ ls -ld /home/fluent
ls: cannot access '/home/fluent': No such file or directory

The alpine image has the homedir created:

$ docker run -it --rm fluent/fluentd:v1.6.2-1.0 sh
/ $ grep fluent /etc/passwd
fluent:x:100:65533:fluent:/home/fluent:/sbin/nologin
/ $ ls -ld /home/fluent
drwxr-sr-x    1 fluent   nogroup         24 Jul 30 06:09 /home/fluent                                                                                                                                                                       

I'm aware that's probably not intentional and is caused by using a different user creation binary (useradd vs adduser), however, it would be good if we can homogenize this. I found it accidentally during a migration from the alpine based to the debian based image after our original code stared to fail due to the missing homedir.

I'm not sure what do you think about, but i suggest following scenarios: A. create a homedir for fluent user also on debian based images. Use -m switch when calling useradd command in both debian and armhf Dockerfiles. B. do not create homedir for fluent user: 1. Use -H switch when calling adduser command in alpine Dockerfile. 2. set homedir to a nonexisting directory /nonexistent or /var/empty for the fluent user to explicitely state we don't want to use it

Let me know your thoughts and if you are super busy, i can help you to implement this.

Thanks!

sbocinec avatar Jul 30 '19 06:07 sbocinec