68 lines
3.3 KiB
Text
68 lines
3.3 KiB
Text
ARG OS_VERSION
|
|
FROM devxygmbh/ubuntu-jags:${OS_VERSION} AS jags
|
|
|
|
ARG OS_VERSION
|
|
FROM ubuntu:${OS_VERSION} AS final
|
|
|
|
ARG R_VERSION
|
|
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
|
ENV TZ="Europe/Berlin"
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
ENV NCPUS=2
|
|
ENV R_LIBS_USER=/mnt/cache/R-pkgs
|
|
ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache
|
|
|
|
ARG GITHUB_PAT
|
|
|
|
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
|
|
|
# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
|
# tcl tk tk-dev tk-table: must be available before running xvfb-run (i.e. starting the graphical session)
|
|
# libmecab-dev: RcppMeCab -> no autodetection yet
|
|
# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container?
|
|
RUN apt update && apt install -y --no-install-recommends gdebi-core g++ gfortran libbz2-dev libblas-dev libicu-dev liblapack-dev liblzma-dev libpaper-utils libpcre2-dev libtcl8.6 libtk8.6 libxt6 unzip zip zlib1g-dev libpcre3-dev libopenblas-dev curl ca-certificates make ccache htop libgit2-dev git libpq-dev libxml2-dev libgit2-dev cmake xvfb libcurl4-openssl-dev xz-utils tcl tk tk-dev tk-table pkg-config libmecab-dev libfftw3-dev automake
|
|
|
|
### CUSTOM DEPENDENCIES
|
|
# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes
|
|
RUN apt-get install -y software-properties-common && \
|
|
add-apt-repository -y ppa:xtradeb/apps && \
|
|
apt update && \
|
|
apt install -y chromium
|
|
|
|
ARG OS_VERSION
|
|
ARG R_VERSION
|
|
RUN if [ "$OS_VERSION" = "jammy" ]; then \
|
|
OS_VERSION_TRIM=2204; \
|
|
CXX_STD=14; \
|
|
elif [ "$OS_VERSION" = "noble" ]; then \
|
|
OS_VERSION_TRIM=2404; \
|
|
CXX_STD=17; \
|
|
fi; \
|
|
if [ "$(arch)" = "x86_64" ]; then \
|
|
export ARCH=amd64; \
|
|
elif [ "$(arch)" = "aarch64" ]; then \
|
|
export ARCH=arm64; \
|
|
fi; \
|
|
curl -v -O "https://devxy-r-builds.fsn1.your-objectstorage.com/${OS_VERSION_TRIM}/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \
|
|
gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \
|
|
rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \
|
|
R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' && \
|
|
mkdir -p /root/.R && \
|
|
bash -c 'echo -e "CXX_STD = $CXX_STD\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' && \
|
|
bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/${OS_VERSION}/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile'
|
|
|
|
### Makevars
|
|
# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66)
|
|
# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4
|
|
|
|
# these dirs will later be used by the CI with existing mounts
|
|
RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs
|
|
|
|
RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
|
|
&& locale-gen en_US.utf8 \
|
|
&& /usr/sbin/update-locale LANG=en_US.UTF-8
|
|
|
|
RUN R -q -e 'getOption("repos"); pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)'
|
|
|
|
CMD ["/bin/bash"]
|