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

[BUG] - Setting PUID/PGID environment variables with the docker container have no effect #2845

Closed
5 of 6 tasks
anoadragon453 opened this issue Dec 15, 2023 · 1 comment · Fixed by #2882
Closed
5 of 6 tasks
Labels
bug Something isn't working triage

Comments

@anoadragon453
Copy link
Contributor

First Check

  • This is not a feature request.
  • I added a very descriptive title to this issue (title field is above this).
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • This issue can be replicated on the demo site (https://demo.mealie.io/).

What is the issue you are experiencing?

Attempting to set the PUID / PGID environment variables for the mealie docker image have no effect. When execing into the container, I see that the mealie process is still running as root (uid 0).

This appears to be due to the change_user function being commented out in #2539:

mealie/docker/entry.sh

Lines 44 to 46 in ca9f66e

# change_user
init
GUNICORN_PORT=${API_PORT:-9000}

Was this intentional?

Steps to Reproduce

  1. Run PUID=555 PGID=555 docker run ghcr.io/mealie-recipes/mealie:v1.0.0-RC2
  2. Run docker exec -it <mealie-container-id> /bin/bash
  3. Inside the container, install ps: apt update && apt install procps -y
  4. View the container's running processes with ps aux
  5. See that /app/run.sh and python are still running as root, when they should be running as abc:
/# ps aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0   2576  1408 ?        Ss   09:22   0:00 /bin/sh -c $MEALIE_HOME/run.sh
root           2  0.0  0.0   2576  1536 ?        S    09:22   0:00 /bin/sh /app/run.sh
root          10  0.9  4.0 371316 157124 ?       Sl   09:23   0:08 /opt/pysetup/.venv/bin/python /opt/pysetup/.venv/bin/uvicorn mealie.app:app --ho
root          16  0.0  0.0   4608  3584 pts/0    Ss   09:28   0:00 /bin/bash
root         182  0.0  0.1   8480  4352 pts/0    R+   09:38   0:00 ps aux

Please provide relevant logs

N/A

Mealie Version

ghcr.io/mealie-recipes/mealie:v1.0.0-RC2

Deployment

Docker (Linux)

Additional Deployment Details

No response

@anoadragon453 anoadragon453 added bug Something isn't working triage labels Dec 15, 2023
@zwimer
Copy link

zwimer commented Dec 28, 2023

This is a must-have for docker containers exposed to a network!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants