{% extends "base.j2" %}
{% block SETUP_BENTO_BASE_IMAGE %}
{{ super() }}
USER root

{% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/yum") }} {% endcall -%} set -eux && \
    yum upgrade -y \
    && yum install -y ca-certificates curl gcc gcc-c++ make bash shadow-utils

ENV UV_SYSTEM_PYTHON=1
RUN curl -LO https://astral.sh/uv/install.sh && \
    sh install.sh && rm install.sh && mv $HOME/.cargo/bin/uv /usr/local/bin/
{% if __options__system_packages is not none %}
# Install user-defined system package
{% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache("/var/cache/yum") }} {% endcall -%} set -eux && \
    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 %}
