Skip to content

fix: start Minecraft Java as non-root - #56

Open
jebediah47 wants to merge 1 commit into
GameplanePanel:mainfrom
jebediah47:fix/minecraft-nonroot
Open

jebediah47 wants to merge 1 commit into
GameplanePanel:mainfrom
jebediah47:fix/minecraft-nonroot

Conversation

@jebediah47

@jebediah47 jebediah47 commented Nov 1, 2026 •

Copy link
Copy Markdown

Minecraft currently starts as root and relies on gosu to drop privileges before launching Java. On our ARM64 host with Ubuntu kernel 7.0.0-42 and gosu 1.19 (Go 1.24.6), gosu spins in sched_yield at 100% CPU; Java never starts and the startup probe cannot connect to port 25565.

Set GameTemplate security.runAsUser, runAsGroup, and fsGroup to 1000. The itzg entrypoint detects non-root execution and launches configuration directly, bypassing gosu. Bump the module and template versions from 2.9.0 to 2.9.1 for publication.

Live validation: applying these security settings to the installed template started Minecraft successfully as UID/GID 1000, preserved the existing world, and passed pod readiness. Existing data was already owned by UID/GID 1000.

Related Ubuntu report: https://bugs.launchpad.net/bugs/2172422

Module validator: passed with zero errors. Advisory warnings cover the existing /data mount matching image WorkingDir and the absence of an explicit HOME; the live Java 25 startup and readiness check passed with these settings. Other Java variants were checked statically, not launched. git diff --check passed.

Summary by CodeRabbit

  • Updates
    • Updated the Minecraft Java module and template bundle to version 2.9.1.
    • Containers now run with UID/GID 1000 and use filesystem group 1000.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b12accb-d5be-464f-b3ff-33968672cfba
Commits

Reviewing files that changed from the base of the PR and between e5774ae and d8afe8a.

Files selected for processing: 2
  • minecraft-java/module.yaml
  • minecraft-java/template.yaml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The Minecraft Java module and template versions change from 2.9.0 to 2.9.1. The template adds a pod security context that sets the run-as user, run-as group, and filesystem group to 1000.

Changes: Minecraft Java update

Layer / File(s) Summary
Release version and pod security context
minecraft-java/module.yaml, minecraft-java/template.yaml
The module and template versions change to 2.9.1. The template sets the run-as user, run-as group, and filesystem group to 1000.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: valgulnecron

Merge Risk: Minimal · up to d8afe

The security-context change is compatible with the supported Minecraft Java image variants based on the inspected image and entrypoint contracts.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: configuring Minecraft Java to start as a non-root user.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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