Docker: The script create-users.sh create 1803 files in the Docker image #2382

Open
opened 2026-02-20 01:10:46 -05:00 by deekerman · 0 comments
Owner

Originally created by @alexislefebvre on GitHub (Aug 7, 2025).

Describe what problem this solves and why this would be valuable to many users

I was analyzing the directories on my server that host an instance of PhotoPrism when I found the home directory for PhotoPrism and it contains 602 users:

docker-compose exec photoprism bash
root@250707:/photoprism$ ls -l /home/ | wc --lines
602

And 601 directories contains 3 files (/home/ubuntu/ is empty):

root@250707:/photoprism$ ls -lha /home/user-2026/
total 36K
drwxr-x--- 2 user-2026 photoprism 4.0K Jul  3 17:38 .
drwxr-xr-x 1 root      photoprism  20K Jul  3 17:38 ..
-rw-r--r-- 1 user-2026 photoprism  220 Mar  5 02:35 .bash_logout
-rw-r--r-- 1 user-2026 photoprism 3.8K Jul  3 17:38 .bashrc
-rw-r--r-- 1 user-2026 photoprism  807 Mar  5 02:35 .profile

That means that when the image is decompressed, Docker have to handle 1803 files that are not necessary.

These files are created by this line: github.com/photoprism/photoprism@2b9a3c9924/scripts/dist/create-users.sh (L59)

This is due to the call to useradd which will copy files from the skeleton: https://manpages.debian.org/bookworm/adduser/adduser.conf.5.en.html#SKEL

Describe the solution you'd like

Create users without adding these files, so that the decompressing of the Docker images may be slightly faster.

For context, the whole Docker image contains 26786 directories and files.

Describe alternatives you've considered

.

Additional context

I'll look into this issue.

Related:

Originally created by @alexislefebvre on GitHub (Aug 7, 2025). **Describe what problem this solves and why this would be valuable to many users** I was analyzing the directories on my server that host an instance of PhotoPrism when I found the `home` directory for PhotoPrism and it contains 602 users: ``` docker-compose exec photoprism bash root@250707:/photoprism$ ls -l /home/ | wc --lines 602 ``` And 601 directories contains 3 files (`/home/ubuntu/` is empty): ``` root@250707:/photoprism$ ls -lha /home/user-2026/ total 36K drwxr-x--- 2 user-2026 photoprism 4.0K Jul 3 17:38 . drwxr-xr-x 1 root photoprism 20K Jul 3 17:38 .. -rw-r--r-- 1 user-2026 photoprism 220 Mar 5 02:35 .bash_logout -rw-r--r-- 1 user-2026 photoprism 3.8K Jul 3 17:38 .bashrc -rw-r--r-- 1 user-2026 photoprism 807 Mar 5 02:35 .profile ``` That means that when the image is decompressed, Docker have to handle 1803 files that are not necessary. These files are created by this line: https://github.com/photoprism/photoprism/blob/2b9a3c992423b6a93f0e29210438288ac8ab1270/scripts/dist/create-users.sh#L59 This is due to the call to `useradd` which will copy files from the skeleton: https://manpages.debian.org/bookworm/adduser/adduser.conf.5.en.html#SKEL **Describe the solution you'd like** Create users without adding these files, so that the decompressing of the Docker images may be slightly faster. For context, the whole Docker image contains 26786 directories and files. **Describe alternatives you've considered** . **Additional context** I'll look into this issue. Related: - #3719
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#2382
No description provided.