{% extends "base_debian.j2" %}
{% block SETUP_BENTO_BASE_IMAGE %}
{{ super() }}

{% call common.RUN(__enable_buildkit__) -%} {{ common.mount_cache(__lib_apt__) }} {{ common.mount_cache(__cache_apt__) }} {% endcall -%} \
    set -eux && \
    apt-get install -y --no-install-recommends --allow-remove-essential software-properties-common && \
    # add deadsnakes ppa to install python
    add-apt-repository ppa:deadsnakes/ppa && \
    apt-get update -y && \
    apt-get install -y --no-install-recommends --allow-remove-essential {% if "ubuntu22.04" in __base_image__ and __options__python_version == "3.10" %}python{{ __options__python_version }}-jammy{% else %}python{{ __options__python_version }}{% endif %} python{{ __options__python_version }}-dev python{{ __options__python_version }}-distutils

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_ENVARS %}

{{ super() }}
{% endblock %}
{% block SETUP_BENTO_ENTRYPOINT %}
RUN rm -rf /var/lib/{apt,cache,log}
{{ super() }}
{% endblock %}
