ARG VERSION
FROM ubuntu:${VERSION} AS jags

RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev
# These usually are not packaged in OS repositories and need to be installed from source
# - JAGS (needed for runjags which itself is again a dependency of many packages)
RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1
