Compare commits

..
3 Commits
Author SHA1 Message Date
marvin f6b0721f06 Rewrite install_into_rootfs doc comment to omit temp-file detail
CI / build (pull_request) Successful in 13s
2026-09-10 12:16:05 +02:00
marvin 3ee93b320e Extract install_into_rootfs helper (U2)
CI / build (pull_request) Successful in 13s
Deduplicate the three near-identical write-temp→install blocks in
inject() into a single install_into_rootfs() helper.
2026-09-10 11:07:32 +02:00
marvin de59e84d73 Respect USER directive from OCI image config
CI / build (pull_request) Successful in 13s
Add support for the Dockerfile USER directive so that the container's
CMD/ENTRYPOINT runs as the configured user instead of root.

Changes:
- inject.rs: Add user field to Config struct, write /slim/user at
  build time
- build.rs: Pass config.user through to inject()
- slim-init.sh: Read /slim/user and drop privileges via su before
  executing the command. Numeric uids are resolved to usernames via
  /etc/passwd (BusyBox su does not accept numeric args). When dropping
  privileges, run as a child (not exec) so PID 1 stays root and can
  poweroff after the command exits.
- test.sh: Add test_user verifying build-time CMD and --cmd override
  both run as the configured user

Closes #7
2026-09-10 00:00:42 +02:00

Diff Content Not Available