mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 11:06:06 +00:00
502e6916d9
Started as root, the entrypoint dropped to the node user with gosu. gosu is a Go program, and Go changes a process's ids by sending every runtime thread a realtime signal and spinning until each one has answered, with no limit. On a host whose security module drops that signal inside the container (AppArmor on recent Ubuntu, under rootful Podman) gosu spun at full CPU forever, before Node printed a line: no logs, no database, port 3000 never served. Running as uid 1000 worked only because that path skips gosu. The entrypoint now drops privileges with setpriv from util-linux, which is already in the image: single-threaded C that makes the same id changes without any signal. Node still runs as uid and gid 1000 with no capabilities and HOME=/home/node. gosu stays in the image for anyone who calls it by hand. Closes #3135