Skip to content

GIT-39: PhotoPrism starts as root, drops to uid 1000 - #8

Merged
noels merged 1 commit into
mainfrom
GIT-39-run-as-root
Sep 28, 2026
Merged

noels merged 1 commit into
mainfrom
GIT-39-run-as-root

Conversation

@noels

@noels noels commented Sep 28, 2026

Copy link
Copy Markdown
Member

The chart's default securityContext (runAsUser 1000) can't boot the image. Its s6-overlay /init needs /run owned by the container user, and the chart has no way to mount a volume there:

preinit: fatal: /run belongs to uid 0 instead of 1000, has insecure and/or unworkable permissions, and we're lacking the privileges to fix it.

Fix, values only (no fork): start as uid 0 with drop: [ALL], adding back only CHOWN/SETUID/SETGID/DAC_OVERRIDE/FOWNER, with allowPrivilegeEscalation: false and seccomp RuntimeDefault kept. Then PHOTOPRISM_UID/GID=1000 has PhotoPrism's init drop the app process to 1000, which is the upstream docker-compose model.

Verified in local Docker with the same restrictions: the photoprism process runs as uid 1000, storage files are owned by 1000:1000, and /api/v1/status returns 200. The alternative (a /run emptyDir + S6_YES_I_WANT_A_WORLD_WRITABLE_RUN_BECAUSE_KUBERNETES) also works, but it needs a forked chart.

🤖 Generated with Claude Code

@noels
noels merged commit e83891f into main Sep 28, 2026
4 checks passed
@noels
noels deleted the GIT-39-run-as-root branch September 28, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant