Support execution as unprivileged user?

Open
#144 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, kubernetes, shell

Research direction

Start by locating every shell entry point that uses exec gosu and review how each command is launched. Check how an unprivileged Kubernetes securityContext affects those paths and define the opt-out behavior around NO_GOSU. Done means the containers can run with an unprivileged uid without gosu failing, while existing privileged execution remains supported.

Written by the indexing model from the issue text.

Description

enhancement

Hi there,

This is exactly what I was looking for - however, I am trying to run (all of) my gameservers in Kubernetes. Depending on the cluster configuration, you may not even be able to run a container as root. Ideally, you would be able to run the containers with a securityContext enforcing an unprivileged uid. In situations like these, gosu will fail outright.

I think this can be as easy as wrapping exec gosu usage in various places with a function call that basically does:


if [ -z $NO_GOSU ]; then
  exec gosu ...
else
  raw_command
fi

I am happy to submit a PR but wanted to get thoughts on adding this before doing it.

Thanks!

Dominant language
Shell
Stars
347
Forks
26
Avg merge
8h 2m
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No 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.

More from GameServerManagers/docker-gameserver

All issues in GameServerManagers/docker-gameserver

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.