Skip to content

[Docker] Run the server image as uid 100:101 so runAsNonRoot works without runAsUser #2283

Open

Description

@newfront

Is your feature request related to a problem? Please describe.

The server image sets its user by name (USER unitycatalog in the Dockerfile).
Kubernetes can't check that a user name is non-root. So if the server container sets
runAsNonRoot: true without runAsUser, the pod fails to start: it stays in
CreateContainerConfigError, with the event
container has runAsNonRoot and image has non-numeric user (unitycatalog), cannot verify user is non-root.

The Pod Security Standards "restricted" profile and common admission policies
(Kyverno, Gatekeeper) require runAsNonRoot. Today users have to find the IDs and set
runAsUser: 100 / runAsGroup: 101 themselves. The chart already depends on these IDs
(podSecurityContext.fsGroup: 101, and the init container runs chown -R 100:101 etc/conf),
and #2224 pinned them in the Dockerfile.

Raised in the review of #2224
(#2224 (comment)). The
problem predates that PR.

To reproduce:

helm install unitycatalog ./helm -n uc --create-namespace \
  --set ui.enabled=false \
  --set server.deployment.securityContext.runAsNonRoot=true
kubectl -n uc get pods        # server pod: CreateContainerConfigError
kubectl -n uc describe pods   # the event above

Describe the solution you would like

  1. Dockerfile: set the user by number, USER 100:101. Keep creating the named account,
    because COPY --chown uses it and id still shows the name.
  2. docs/server/helm.md: add a short example of running the server as non-root:
    server:
      deployment:
        securityContext:
          runAsNonRoot: true
          allowPrivilegeEscalation: false
          capabilities:
            drop: [ALL]
    It goes on the server container, not in podSecurityContext. The init container runs as
    root because it calls apk add and chown when it renders the config.
  3. CI: install the chart with the same securityContext in all three database jobs of the
    Helm workflow. That tests the documented setting, and CI fails if the image's user stops
    being numeric.

Acceptance criteria

  • docker inspect --format '{{.Config.User}}' on the built image prints 100:101.
  • With the securityContext above and no runAsUser, the server pod becomes Ready and
    helm test passes for H2, PostgreSQL and MySQL. MySQL is worth checking because it
    loads its driver through --module-path.
  • Without the setting, nothing changes: the server runs as 100:101, $HOME is mode 550,
    and the workflow's standalone image smoke step passes.

Out of scope (separate issues if wanted)

  • runAsNonRoot at pod level, and with it the full "restricted" profile. That needs a
    non-root init container, for example a pre-built config-rendering image instead of
    apk add at startup, with fsGroup replacing the chown.
  • Turning these settings on by default in values.yaml. That changes existing installs, so
    it's a maintainer decision. A reviewer suggested defaults like these on the original
    chart PR (Add helm chart for unitycatalog #895), but they weren't adopted.
  • readOnlyRootFilesystem: the server writes etc/logs inside the image.

Additional context

Images built FROM this one that use USER unitycatalog keep working, since the account
still exists. The change is small: one line in the Dockerfile, plus docs and one CI change.

Activity

  1. added
    enhancement
    on Nov 18, 2026
  2. added this to the 0.8 milestone on Nov 18, 2026
  3. added theissue type on Nov 18, 2026
  4. newfront commented on Nov 18, 2026

    @newfront
    CollaboratorAuthor

    @shba24 not sure if your new PRs cover this fix as well.

  5. jeevitra commented on Nov 19, 2026

    @jeevitra

    Hi! I’d be happy to take this on. I’ll update the image to use USER 100:101, document the server container securityContext, and add the same configuration to the H2, PostgreSQL, and MySQL Helm CI jobs. I’ll also validate the acceptance criteria before submitting the PR. Could you assign this to me?

    /claim

  6. newfront commented on Nov 19, 2026

    @newfront
    CollaboratorAuthor

    Sure. Thanks for picking this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issue

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions