TimWolla / docker-adminer

Database management in a single PHP file
https://hub.docker.com/_/adminer/
157 stars 69 forks source link

Add ability to set uid and gid of adminer user in docker #127

Closed hongkongkiwi closed 1 year ago

hongkongkiwi commented 1 year ago

I would like to set the internal uid and gid that the adminer user uses. I think this is a useful change.

I want to recommend changing the adminer uid and guid in the entrypoint script these two lines should do the trick:

PUID="${PUID:-100}"
PGID="${PGID:-101}"
usermod -u $PUID adminer
groupmod -g $PGID adminer

And add these to the Dockerfile to set existing defaults so nothing breaks and also we need to install the shadow package so we have usermod:

apk --no-cache add shadow
ENV PUID=100
ENV PGID=101

Specifically this is used in my case for when I map docker plugin files.

TimWolla commented 1 year ago

You can use Docker's --user flag to specify a user of your choice to run the image.