tursodatabase / tursodatabase/libsql

run docker container as non-root

Open
#2,060 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Current Behavior

The current Docker image creates and uses user sqld and root, which works fine for standard Docker deployments. However, when running in Kubernetes with security constraints like readOnlyRootFilesystem: true, we encounter permission issues because the container attempts to change ownership of files in the mounted volumes.

Proposal

Consider using a higher UID/GID in the range of 10000-65535 (specifically 10001 is commonly used in Kubernetes environments). This range is:

  • Less likely to conflict with host system users
  • Aligns with Kubernetes security best practices
  • Follows the practices of many official container images designed for Kubernetes

Use Case

In Kubernetes environments, especially those following security best practices, it's common to:

  • Run containers with readOnlyRootFilesystem: true
  • Use fsGroup for volume ownership rather than in-container chown
  • Avoid privileged containers or init containers when possible

Making the container work well in these environments would benefit users running in hardened Kubernetes clusters.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Docker image definition and tracing how the sqld and root users are created, selected, and used for mounted-volume ownership. Check the image under read-only-root-filesystem and Kubernetes fsGroup constraints; done means it runs with a high non-root UID/GID without requiring in-container chown.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.