mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 09:13:02 +03:00
Unable to run server in container with a non root user #120
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MartinK07 on GitHub.
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config & Details (Generated via diagnostics page)
Show Config & Details
Config:
Vaultwarden Build Version
vaultwarden/server:1.34.1
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
None
Host/Server Operating System
Linux
Operating System Version
Fedora 42
Clients
Web Vault
Client Version
No response
Steps To Reproduce
runAsNonRoot: truesetting in Kubernetes):Expected Result
Process starts and is able to write into the
/datadirectory.Actual Result
Container fails to write into
/data, because the permissions are readonly for the user that the vaultwarden process starts under (UID 1000 | GID 0)Logs
Screenshots or Videos
No response
Additional Context
Even if the default user for the container user is overwritten e.g.
--user 1000orrunAsNonRoot: true+runAsUser: 1000in Kubernetes, the groupid usually stays GID 0 (root):With this in mind, a simple fix for this would be setting the permissions for the
/datadirectory during the dockerbuild process to 775 instead of 755.