refactor: containerfile setups
This commit is contained in:
parent
1ec3605c9f
commit
1d06a52221
1 changed files with 184 additions and 380 deletions
68
docker/Containerfile-redhat
Normal file
68
docker/Containerfile-redhat
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
ARG OS_VERSION
|
||||
FROM devxygmbh/redhat-jags:${OS_VERSION} AS jags
|
||||
|
||||
ARG OS_VERSION
|
||||
FROM redhat/ubi${OS_VERSION} AS final
|
||||
|
||||
ARG R_VERSION
|
||||
ARG RED_HAT_DEV_PW
|
||||
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
||||
ENV TZ="Europe/Berlin"
|
||||
ENV R_LIBS_USER=/mnt/cache/R-pkgs
|
||||
ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache
|
||||
|
||||
ENV NCPUS=2
|
||||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
||||
|
||||
ARG OS_VERSION
|
||||
RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-${OS_VERSION}-$(arch)-rpms
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_VERSION}.noarch.rpm && dnf install -y epel-release
|
||||
# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
||||
# ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs
|
||||
# mecab-devel: RcppMeCab -> no autodetection yet
|
||||
# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container?
|
||||
ARG OS_VERSION
|
||||
RUN if [ "$OS_VERSION" = "8" ]; then \
|
||||
dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2_1.7-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel; \
|
||||
elif [ "$OS_VERSION" = "9" ] || [ "$OS_VERSION" = "10" ]; then \
|
||||
dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel; \
|
||||
fi;
|
||||
|
||||
### CUSTOM DEPENDENCIES
|
||||
# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes
|
||||
RUN dnf install -y chromium
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/el${OS_VERSION}/R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN 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))'
|
||||
|
||||
RUN if [ "$OS_VERSION" = "8" ]; then \
|
||||
export CXX_STD=14; \
|
||||
elif [ "$OS_VERSION" = "9" ]; then \
|
||||
export CXX_STD=17; \
|
||||
elif [ "$OS_VERSION" = "10" ]; then \
|
||||
export CXX_STD=20; \
|
||||
fi; \
|
||||
if [ "$(arch)" = "x86_64" ]; then \
|
||||
export ARCH=amd64; \
|
||||
elif [ "$(arch)" = "aarch64" ]; then \
|
||||
export ARCH=arm64; \
|
||||
fi; \
|
||||
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(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel${OS_VERSION}/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' && \
|
||||
bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-${OS_VERSION}\"" > /root/.Renviron'
|
||||
|
||||
### 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 R -q -e 'getOption("repos"); pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)'
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
Loading…
Reference in a new issue