Difference between PGID/PUID and GID/UID when setting up docker containers

eridani asked:

I’m new to Docker and I’ve seen that some scrips for running containerized software require to specify either of those to match certain user and group. So I was wondering what is the difference between both? Examples below to illustrate.

Jellyfin uses UID/GID pair:

docker run -d \
    --name="Jellyfin" \
    --restart=always \
    --network=host \
    -p 8096:8096 \
    -e UID=1000 \
    -e GID=1000 \
    -v /media:/media \
    -v $HOME/docker/jellyfin/config:/config \

While Calibre-web uses PUID/PGID set:

docker create --name=calibre-web --restart=always \
    -v ~/books:/books \
    -v /etc/localtime:/etc/localtime:ro \
    -e PGID=1000 -e PUID=1000 \
    -p 8081:8083 \

While looking for info I even saw some random github repos that changed from the former to the later at some point; what’s the difference between both options?

My answer:

I understood your question to be: “Why are these variables called PUID and PGID instead of UID and GID”? In fact they could be named anything at all. Neither Docker nor Linux care. It’s the application that decides what to do with them.

Further searching revealed that this is merely a convention, and some applications do their own thing. For instance, one application uses the environment variables MAYAN_USER_UID and MAYAN_USER_GID respectively.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.