wodby / php

Generic PHP docker container images
MIT License
156 stars 103 forks source link

Allow rebuilding image with uid and/or gid higher than 256000 #158

Closed stejes closed 3 years ago

stejes commented 3 years ago

The wodby docs state that if you need the wodby user to have a different uid and gid than 1000 (for permission purposes across host/container), that you should rebuild the image with the WODBY_USER_ID and WODBY_GROUP_ID build args. However, this did not work for me since adduser and addgroup don't accept values higher than 256000. I cannot locally change these values on my machine because it is managed by my work.

I created a pull request that solves the issue for me: #157, by installing and using the useradd and groupadd commands instead. Maybe there are better solutions possible. Any feedback welcome. There is a similar pull request #112, but that didn't seem quite right.

Fyi, I use docker-compose to rebuild with the ids as such:


php:
    build:
      context: https://github.com/stejes/wodby-php.git#fix-uid-issue:8
      args:
        WODBY_USER_ID: 664924666
        WODBY_GROUP_ID: 664200777
        PHP_VER: 8.0
        PHP_DEV: -dev
...
csandanov commented 3 years ago

Merged, thank you