FROM archlinux:latest

RUN pacman-key --init
RUN pacman-key --populate archlinux
RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm

RUN pacman -Syu --noconfirm
RUN pacman -S make perl texlive texlive-binextra texlive-pictures --noconfirm
RUN pacman -S texlive-publishers texlive-mathscience texlive-fontsextra texlive-latexextra --noconfirm
RUN pacman -Syu biber texlive-bibtexextra --noconfirm

# The 'bbm' package insists on generating stuff in the home directory. In
# order to guarantee access to the home directory no matter the user the
# docker container is run with, create a temporary one anyone can write to
RUN mkdir /tmp/home
RUN chmod -R 777 /tmp/home
ENV HOME=/tmp/home

# Generate font necessary for \mathbbm{1}
RUN mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 bbm10
RUN chmod -R 777 /tmp/home

# For some reason simply installing 'biber' does not set the path
ENV PATH="${PATH}:/usr/bin/vendor_perl"

