You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Startup tasks should finish within 15 minutes, even with large filesystems mounted under /config/www (for example when using Linuxserver Nextcloud which inherits from this image.
Current Behavior
Startup script 20-permissions uses recursive chmod commands to check/set file/directory permissions. Chmod runs the fchmodat system call on every file it finds, requiring a disk write for every file in your filesystem. A hundred thousand files on a spinning disk or remote filesystem can easily take > 15 minutes.
Steps to Reproduce
Start this container with a remote filesystem with tens of thousands of files mounted at /config/www. Consider downloading the codebase and deps for a few webapps to simulate one of the downstream projects with user content.
run time ./20-permissions
Tell us what should happen
Downstream image docker-bookstack already solved this problem for their own startup script by converting the chown statement on their data directory to use find -exec instead. This approach first reads file metadata from the in-memory filesystem cache, and only performs writes when necessary. It offers an order-of-magnitude speed improvement, even in the worst case scenario with an unprimed cache and slow remote filesystem.
Environment
OS: Ubuntu 22.04 (but it would be worse on Windows) CPU architecture: x86_64/arm64 How docker service was installed: from docker official scripts, or from apt, or even with podman - doesn't affect the problem
Command used to create docker container (run/create/compose/screenshot)
Expected Behavior
Startup tasks should finish within 15 minutes, even with large filesystems mounted under
/config/www
(for example when using Linuxserver Nextcloud which inherits from this image.Current Behavior
Startup script
20-permissions
uses recursivechmod
commands to check/set file/directory permissions. Chmod runs thefchmodat
system call on every file it finds, requiring a disk write for every file in your filesystem. A hundred thousand files on a spinning disk or remote filesystem can easily take > 15 minutes.Steps to Reproduce
/config/www
. Consider downloading the codebase and deps for a few webapps to simulate one of the downstream projects with user content.time ./20-permissions
Tell us what should happen
Downstream image docker-bookstack already solved this problem for their own startup script by converting the chown statement on their data directory to use
find -exec
instead. This approach first reads file metadata from the in-memory filesystem cache, and only performs writes when necessary. It offers an order-of-magnitude speed improvement, even in the worst case scenario with an unprimed cache and slow remote filesystem.Environment
OS: Ubuntu 22.04 (but it would be worse on Windows)
CPU architecture: x86_64/arm64
How docker service was installed: from docker official scripts, or from apt, or even with podman - doesn't affect the problem
Command used to create docker container (run/create/compose/screenshot)
Docker logs
The text was updated successfully, but these errors were encountered: