Docker Permissions log directory missing/mismapped
When the logs
folder's ownership belongs to the aura
user within the normal file system, Docker assigns it to nobody:nogroup
, which introduces an ownership mismatch between the two environments. Then you get the following error:
engine-core | Logging to '../logs/engine-core.log' with log level 5
engine-core | init: exception encountered during start phase:
engine-core | Sys_error("../logs/engine-core.log: Permission denied")
Here is how it looks like inside docker:
docker compose run engine-core /bin/bash
aura@578e4f612d3e:~$ ls -lart
total 40
-rw-rw-r-- 1 aura aura 12 Jan 24 14:54 VERSION
drwxr-xr-x 1 aura aura 4096 Jan 24 14:54 tests
-rwxrwxr-x 1 aura aura 359 Jan 24 14:54 entrypoint.sh
-rw-rw-r-- 1 aura aura 3197 Jan 24 14:54 Makefile
drwxr-xr-x 1 aura aura 4096 Jan 30 09:46 src
drwxr-xr-x 2 aura aura 4096 Jan 30 12:57 socket
drwxr-xr-x 1 aura aura 4096 Jan 30 12:57 config
drwxrwxr-x 2 nobody nogroup 4096 Jan 30 13:05 logs
drwxr-xr-x 1 root root 4096 Jan 30 13:39 ..
drwxr-xr-x 1 aura aura 4096 Jan 30 13:39 .
Interesting Note: If in the engine-core
normal environment, the logs
folder is designated to belong to the user mina
, who is a member of the aura
group. Within Docker, it is claimed by the user root
.