-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Docker Image Cannot Run as Non-Root User - Documentation Examples Don't Work
Summary
The official documentation shows running Listenarr with --user 1001:1001, but this configuration causes immediate crash loops due to filesystem permission issues in the Docker image. The image cannot run as a non-root user despite what the docs claim.
Environment
- Image:
ghcr.io/therobbiedavis/listenarr:canary - Tag:
canary(tested 2026-01-15, latest as of issue date) - Docker Version: 24.0.7
- Host OS: Linux (Ubuntu 22.04)
Expected Behavior (Per Official Docs)
From the official README:
docker run -d \
## Replace with your desired UID and GID
--user 1001:1001 \
--name listenarr \
-p 4545:4545 \
-v listenarr_data:/app/config \
ghcr.io/therobbiedavis/listenarr:canaryExpected: Container starts successfully, runs as UID 1001
Actual Behavior
Actual: Container enters crash loop with permission denied errors:
System.UnauthorizedAccessException: Access to the path '/app/config/dataprotection-keys' is denied.
---> System.IO.IOException: Permission denied
at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
at System.IO.Directory.CreateDirectory(String path)
at Program.<Main>$(String[] args) in /home/runner/work/Listenarr/Listenarr/listenarr.api/Program.cs:line 654
Root Cause
Inspection of the Docker image reveals that /app/config is baked into the image with restrictive permissions:
$ docker run --rm --entrypoint ls ghcr.io/therobbiedavis/listenarr:canary -la /app/ | grep config
drwxr-xr-x 3 root root 4096 Jan 14 23:30 configThe issue:
/appdirectory is owned byroot:rootwith755permissions/app/configsubdirectory exists in the image asroot:root- When running as non-root user (e.g., 1001), the application cannot create subdirectories in
/app/config/ - Application tries to create:
/app/config/appsettings//app/config/dataprotection-keys/
- Permission denied → crash loop
Steps to Reproduce
- Create docker-compose.yml:
version: '3.8'
services:
listenarr:
image: ghcr.io/therobbiedavis/listenarr:canary
user: "1001:1001"
ports:
- "4545:4545"
volumes:
- listenarr_data:/app/config
volumes:
listenarr_data:- Run:
docker-compose up - Observe crash loop in logs
Tested Workarounds (None Work)
| Workaround | Result |
|---|---|
| Pre-create volume with correct ownership | ❌ Still fails - parent /app restricts subdirectory creation |
Use different mount point (/config) |
❌ App hardcoded to use /app/config |
| Fix permissions in entrypoint script | ❌ Would require root (defeats purpose of non-root) |
Current Working Configuration (Insecure)
The only working configuration is to run as root:
listenarr:
image: ghcr.io/therobbiedavis/listenarr:canary
# NO user: directive - runs as root
ports:
- "4545:4545"
volumes:
- listenarr_data:/app/configThis violates Docker security best practices and contradicts the official documentation.
Reactions are currently unavailable