Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No variables PUID and PGID #111

Open
neutralvibes opened this issue Jul 17, 2023 · 5 comments
Open

No variables PUID and PGID #111

neutralvibes opened this issue Jul 17, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@neutralvibes
Copy link

neutralvibes commented Jul 17, 2023

Seems as if agents are forced to run as '100:101' in container. Not nice. Would be nicer if what now appears to be a standard is used.

environment:
  PUID=1005 # User
  PGID=102 # Group
  othervars=....

This will also allow for required user access outside the container without requiring root. Forgive me if there is already a way to do this.

@cedricve cedricve added the enhancement New feature or request label Jul 17, 2023
@cedricve
Copy link
Member

Thanks you are making a valid point. For the moment we are creating a new user (without root privileges) inside the container. https://github.com/kerberos-io/agent/blob/master/Dockerfile#L96-L99

We might need to change this to allow host user access. Will need to be researched and documented. Thank you for your insights! ;)

@yllekz
Copy link

yllekz commented Aug 19, 2023

Yes please add PUID and GID variables. I recently moved my agent docker container to openmediavault but I think it's failing to record events due to permissions problems and normally this is fixed by having the user/group ID configurable via variables (see also linuxserver's docker containers)

@cedricve
Copy link
Member

cedricve commented Aug 20, 2023

Would this be sufficient (https://docs.linuxserver.io/general/understanding-puid-and-pgid). It mentions:

We are aware that recent versions of the Docker engine have introduced the --user flag. Our images are not yet compatible with this, so we recommend continuing usage of PUID and PGID.

Would this work as well? https://docs.docker.com/engine/reference/run/#user

Currently we create our own user within the agent, and set it as the user: https://github.com/kerberos-io/agent/blob/master/Dockerfile#L134

I believe this could be bypassed as follow:

docker run -p 80:80 --name mycamera  --user=uid:gid -d --restart=always kerberos/agent:latest

@cedricve
Copy link
Member

cedricve commented Sep 7, 2023

@yllekz @neutralvibes any thoughts?

@winston0410
Copy link

Just came across this issue, for K8S if I set runAsNonRoot: true, I will also need to set runAsUser: <uid>. @cedricve From the dockerfile I can see there is an non-root user, but there seems not to be an uid set for the user? A static UID would be nice and easier for config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants