FROM rocker/verse:4.1.1

# COPY the JAGS source code into the image under /tmp
COPY JAGS-4.3.0.tar.gz /tmp

# RUN a series of commands to unpack the JAGS source, compile it, and install it
RUN cd /tmp \
 && tar -xzf JAGS-4.3.0.tar.gz \
 && cd JAGS-4.3.0 \
 && ./configure \
 && make \
 && make install

# rjags is required for bayesian first aid
RUN apt-get update && apt-get install -y software-properties-common # to be able to run add-apt-repository
RUN apt-get install -y r-cran-rjags

# Install packages for markdown files
RUN R -e "install.packages('markdown')"
RUN R -e "install.packages('rmarkdown')"

RUN installGithub.r rasmusab/bayesian_first_aid

# For formatting
RUN R -e "install.packages('formatR')"

# For tables
RUN R -e "install.packages('pander')"
