You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TGI container is currently running with the root user. It is not a good practice to run in productive environments. It is suggested to run the container using a user other than root - create it when building the image.
I used this solution:
FROM ghcr.io/huggingface/text-generation-inference:3.0.0-rocm RUN groupadd --gid 2000 user \ && useradd --uid 2000 --gid user --shell /bin/bash --create-home user RUN usermod -a -G video,render user USER root RUN chown user:user /tgi-entrypoint.sh USER user RUN chmod +x /tgi-entrypoint.sh ENTRYPOINT ["/tgi-entrypoint.sh"]
Motivation
It is highly advisable to use a non-root user to run containers in productive environments.
Your contribution
FROM ghcr.io/huggingface/text-generation-inference:3.0.0-rocm RUN groupadd --gid 2000 user \ && useradd --uid 2000 --gid user --shell /bin/bash --create-home user RUN usermod -a -G video,render user USER root RUN chown user:user /tgi-entrypoint.sh USER user RUN chmod +x /tgi-entrypoint.sh ENTRYPOINT ["/tgi-entrypoint.sh"]
The text was updated successfully, but these errors were encountered:
Feature request
The TGI container is currently running with the root user. It is not a good practice to run in productive environments. It is suggested to run the container using a user other than root - create it when building the image.
I used this solution:
FROM ghcr.io/huggingface/text-generation-inference:3.0.0-rocm
RUN groupadd --gid 2000 user \
&& useradd --uid 2000 --gid user --shell /bin/bash --create-home user
RUN usermod -a -G video,render user
USER root
RUN chown user:user /tgi-entrypoint.sh
USER user
RUN chmod +x /tgi-entrypoint.sh
ENTRYPOINT ["/tgi-entrypoint.sh"]
Motivation
It is highly advisable to use a non-root user to run containers in productive environments.
Your contribution
FROM ghcr.io/huggingface/text-generation-inference:3.0.0-rocm
RUN groupadd --gid 2000 user \
&& useradd --uid 2000 --gid user --shell /bin/bash --create-home user
RUN usermod -a -G video,render user
USER root
RUN chown user:user /tgi-entrypoint.sh
USER user
RUN chmod +x /tgi-entrypoint.sh
ENTRYPOINT ["/tgi-entrypoint.sh"]
The text was updated successfully, but these errors were encountered: