Skip to content

Commit

Permalink
fix(containerize): command to create group and user in alpine base im…
Browse files Browse the repository at this point in the history
…age (#4855)

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming authored Jul 12, 2024
1 parent 247649e commit bb6447f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ENV NVIDIA_VISIBLE_DEVICES=
ARG BENTO_USER={{ bento__user }}
ARG BENTO_USER_UID={{ bento__uid_gid }}
ARG BENTO_USER_GID={{ bento__uid_gid }}
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
{% endblock %}
{% block SETUP_BENTO_ENVARS %}
{% if __options__env is not none %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ ENV ENV /root/.bashrc
apk add --update {{ __options__system_packages | join(' ') }}
{% endif -%}
{% endblock %}

{% block SETUP_BENTO_USER %}
{{ super() }}
RUN addgroup -g $BENTO_USER_GID -S $BENTO_USER && adduser -u $BENTO_USER_UID -G $BENTO_USER -S $BENTO_USER
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
RUN ln -sf /usr/bin/python{{ __options__python_version }} /usr/bin/python3 && \
ln -sf /usr/bin/pip{{ __options__python_version }} /usr/bin/pip3
{% endblock %}

{% block SETUP_BENTO_USER %}
{{ super() }}
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa
apt-get install -q -y --no-install-recommends --allow-remove-essential \
ca-certificates gnupg2 bash build-essential {% if __options__system_packages is not none %}{{ __options__system_packages | join(' ') }}{% endif -%}
{% endblock %}

{% block SETUP_BENTO_USER %}
{{ super() }}
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ USER root
yum install -y {{ __options__system_packages | join(' ') }}
{% endif -%}
{% endblock %}

{% block SETUP_BENTO_USER %}
{{ super() }}
RUN groupadd -g $BENTO_USER_GID -o $BENTO_USER && useradd -m -u $BENTO_USER_UID -g $BENTO_USER_GID -o -r $BENTO_USER
{% endblock %}

0 comments on commit bb6447f

Please sign in to comment.