FROM bitnami/moodle:{{ applications[application_id].version }} {% if applications | is_feature_enabled('oidc', application_id) %} RUN install_packages unzip curl jq \ && VERSION=$(curl -s https://api.github.com/repos/microsoft/moodle-auth_oidc/tags \ | jq -r '.[].name' \ | grep v{{ applications[application_id].version }} \ | sort -Vr \ | head -n1) \ && echo "Using version $VERSION" \ && curl -L -o /tmp/oidc.zip https://github.com/microsoft/moodle-auth_oidc/archive/refs/tags/${VERSION}.zip \ && unzip /tmp/oidc.zip -d /tmp \ && mv /tmp/moodle-auth_oidc-* {{ bitnami_oidc_plugin_dir }} \ && chown -R {{ bitnami_user_group }} {{ bitnami_oidc_plugin_dir }} \ && rm -rf /tmp/oidc.zip {% endif %}