docker containers runs as root, ignores PUID/PGID setting

  • Hi everybody, I have several docker containers running (i.e. Plex, beets, watchtower) without issues. I'm no expert on docker so if possible I prefer the containers from linuxserver.io, as I found these are easy to setup with consistent settings and good instructions on usage. But I now have one container appears to run as root (which is undesirable).


    I set the PUID 1000 and PGID 100 in the container settings, but the docker seems to ignore these. The container isn't from linuxserverio and doesn't have these PUID/PGID fields in the installation guide. But I thought these settings were universal, was that wrong? It would also help to know if this is more likely a problem in the container, or in the OMV Docker plugin. Any help is appreciated on how I can force the right user settings to run the docker.

  • Don't use container environment variables from one container with another unless you are sure they are supported.


    Is there some reason you did not mention the name of the container you are having problems wit?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • I set the PUID 1000 and PGID 100 in the container settings, but the docker seems to ignore these. The container isn't from linuxserverio and doesn't have these PUID/PGID fields in the installation guide. But I thought these settings were universal, was that wrong?

    sorry PUID & GUID are not universal.


    You need to locate a container that splicity use this or simmilar variables to change owner

  • It is kind of common to allow a root user inside docker containers to run it. The environmant variables you named are used by a startup script inside the container, it only works if devs did it this exact way.
    A lot of containers even require the user to be root. You may want to have a look at openshift docu for workarounds in those containers, openshift does not allow root in docker and therefore its a commen task there.
    If you want to try, start docker with the - - user flag, but it depends on the container if you need further changes. You will propably run into rights issues inside the containet. If the container is not started in privileged mode I dont see too much of an issue going root inside docker, depending on the specific container used of course.

  • Thanks for all the feedback. No specific reason not to mention the dockers, it was just late on my side and time to :sleeping:


    These ones are running fine with the PUID/GUID set, which matters because they write files to the disk:
    https://hub.docker.com/r/linuxserver/plex
    https://hub.docker.com/r/linuxserver/beets


    This one runs without PUID/PGID, but it doesn't write to the disk so that's not a problem:
    https://hub.docker.com/r/v2tec/watchtower


    This is the new docker container:
    hub.docker.com/r/storjlabs/storagenode : alpha
    It runs in non-priviledged mode and seems to work as it should. My issue with it is that the files it saves to the disk are all owned by root:users and not by my normal user. It's an early alpha so not everything is implemented in the docker container at this stage. I'll ask if they can include something like this user/group setting in a future release. I don't want to break privileges in the container so probably best to ask them to implement this, rather than create a workaround.


    My mistake for thinking these PUID/PGID settings were universal. I'll just stick with the linuxserver.io containers whenever I can.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!