FROM --platform=linux/amd64 archlinux:base-devel

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm git xxhash lmdb re2c valgrind gdb graphviz

WORKDIR /opt/lsup/lsup_rdf/src
RUN git clone --recurse-submodules https://git.knowledgetx.com/scossu/lsup_rdf.git
WORKDIR lsup_rdf

RUN useradd --create-home -G wheel lsup
RUN echo "%wheel ALL=(ALL:ALL) NOPASSWD:ALL" >| /etc/sudoers.d/wheel
RUN chown -R lsup:lsup .

USER lsup

ENV LD_LIBRARY_PATH /opt/local/lsup

CMD ["/usr/bin/bash"]