From 65cd8ba3ca2c3c09947ad58656bbd962a1f68dbc Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 30 Jul 2024 16:12:31 +0200 Subject: [PATCH] add dockerfile and justfile --- Justfile | 9 ++++++--- docker/Dockerfile-rhel8 | 21 ++++++++++++++++++++ docker/{Dockerfile-ubi9 => Dockerfile-rhel9} | 0 docker/Dockerfile-ubuntu-2404 | 19 ++++++++++++++++++ docker/Dockerfile.rhel8 | 15 -------------- 5 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 docker/Dockerfile-rhel8 rename docker/{Dockerfile-ubi9 => Dockerfile-rhel9} (100%) create mode 100644 docker/Dockerfile-ubuntu-2404 delete mode 100644 docker/Dockerfile.rhel8 diff --git a/Justfile b/Justfile index 6c7df70..842ad63 100644 --- a/Justfile +++ b/Justfile @@ -1,3 +1,6 @@ -build_rhel8_image: - docker buildx build -f docker/Dockerfile.rhel8 --build-arg RED_HAT_DEV_PW=$RED_HAT_DEV_PW -t devxy/rhel8_rpkg_ -binaries:latest --load . +image OS: + if echo "{{OS}}" | grep -qi "rhel"; then \ + docker buildx build --build-arg RED_HAT_DEV_PW='ujF@4A^yn$6utRhb&UooGH#w' -f docker/Dockerfile-{{OS}} -t pats22/arm-binaries-r-{{OS}}:latest --push .; \ + else \ + docker buildx build -f docker/Dockerfile-{{OS}} -t pats22/arm-binaries-r-{{OS}}:latest --push .; \ + fi \ No newline at end of file diff --git a/docker/Dockerfile-rhel8 b/docker/Dockerfile-rhel8 new file mode 100644 index 0000000..a414796 --- /dev/null +++ b/docker/Dockerfile-rhel8 @@ -0,0 +1,21 @@ +FROM redhat/ubi8:8.10-1020 + +ARG RED_HAT_DEV_PW +ENV PATH=/opt/R/4.4.1/bin:$PATH +ENV TZ="Europe/Berlin" + +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-aarch64-rpms +### install JAGS (needed for runjags which itself is again a dependency of many packages) +RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel +RUN curl -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 && make && make install && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd .. +RUN dnf install -y -q https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/h/hiredis-0.13.3-13.el8.aarch64.rpm && dnf install -y -q https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/c/ccache-3.7.7-1.el8.aarch64.rpm +RUN curl -O https://f003.backblazeb2.com/file/devxy-r-builds/el8/R-4.4.1-1-1.aarch64.rpm +RUN dnf install -q -y R-4.4.1-1-1.aarch64.rpm +RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +COPY . . +RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE, PKG_SYSREQS_PLATFORM = "redhat-8"); pak::pak()' +RUN R CMD INSTALL . +RUN rm -rf arm-binaries-r + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile-ubi9 b/docker/Dockerfile-rhel9 similarity index 100% rename from docker/Dockerfile-ubi9 rename to docker/Dockerfile-rhel9 diff --git a/docker/Dockerfile-ubuntu-2404 b/docker/Dockerfile-ubuntu-2404 new file mode 100644 index 0000000..d2fdcdc --- /dev/null +++ b/docker/Dockerfile-ubuntu-2404 @@ -0,0 +1,19 @@ +FROM ubuntu:noble-20240605 + +ENV PATH=/opt/R/4.4.1/bin:$PATH +ENV TZ="Europe/Berlin" + +### install JAGS (needed for runjags which itself is again a dependency of many packages) +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 + +RUN curl -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 && make && make install && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd .. +RUN curl -O https://f003.backblazeb2.com/file/devxy-r-builds/2404/r-4.4.1_1_arm64.deb +RUN gdebi -n -qq r-4.4.1_1_arm64.deb && rm r-4.4.1_1_arm64.deb +RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +COPY . . +RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE, PKG_SYSREQS_PLATFORM = "ubuntu-24.04"); pak::pak()' +RUN R CMD INSTALL . +RUN rm -rf arm-binaries-r + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile.rhel8 b/docker/Dockerfile.rhel8 deleted file mode 100644 index 9ea3c30..0000000 --- a/docker/Dockerfile.rhel8 +++ /dev/null @@ -1,15 +0,0 @@ -FROM redhat/ubi8 - -ARG R_VERSION=4.0.5 -ARG RED_HAT_DEV_PW - -RUN subscription-manager register --username pat-s --password $RED_HAT_DEV_PW && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms && dnf update - -RUN dnf -y install --nodocs git rsync - -RUN echo "R Version: ${R_VERSION}" && echo "Downloading R-${R_VERSION}.rpm from S3..." && curl -o /tmp/R-${R_VERSION}.rpm https://cynkra-r-builds-arm64.s3.eu-central-1.amazonaws.com/el8/R-"${R_VERSION}"-1-1."$(arch)".rpm && dnf install --nodocs -y /tmp/R-${R_VERSION}.rpm && rm -rf /tmp/R-${R_VERSION}.rpm - -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV R_PROGRESSR_ENABLE=TRUE - -CMD ["R"]