TeamSpeak-Systems / teamspeak-linux-docker-images

docker build files for TeamSpeak servers
Other
114 stars 52 forks source link

Support running as custom user #38

Closed ghost closed 4 years ago

ghost commented 4 years ago

This image should support user/UID and group/GID environment variables, and running ts3server as a specified user instead of the currently hardcoded 9987.

It0w commented 4 years ago

you can use the --user parameter for docker

USER

root (id = 0) is the default user within a container. The image developer can create additional users. Those users are accessible by name. When passing a numeric ID, the user does not have to exist in the container.

The developer can set a default user to run the first process with the Dockerfile USER instruction. When starting a container, the operator can override the USER instruction by passing the -u option.

-u="", --user="": Sets the username or UID used and optionally the groupname or GID for the specified command.

The followings examples are all valid:
--user=[ user | user:group | uid | uid:gid | user:gid | uid:group ]

    Note: if you pass a numeric uid, it must be in the range of 0-2147483647.

source: https://docs.docker.com/engine/reference/run/ example:

--user $(id -u USER):$(id -g GROUP)

works fine for 3.9.1

cheers Itow :D

ghost commented 4 years ago

Running Podman, not Docker. I'm already using the runAsUser Kube YAML directive, no luck (it usually works, of course).

ghost commented 4 years ago

Podman only introduced support for runAsUser in https://github.com/containers/libpod/releases/tag/v1.7.0, safe to say @It0w was probably right.