From 0556bc3bc1f496f3f438b3ecd80a40922c425728 Mon Sep 17 00:00:00 2001 From: Eli Holmes - NOAA Date: Sun, 24 Nov 2024 09:36:45 -0700 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 90bd8ad..a4ecc30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,9 @@ USER root ENV REPO_DIR="/srv/repo" \ DISPLAY=":1.0" \ R_VERSION="4.4.1" +# The latest rocker will set CRAN to 'latest' but we need a date stamped version for reproducibility +# So pull the latest and use one earlier +ARG R_VERSION_PULL="4.4.2" # Add NB_USER to staff group (required for rocker script) # Ensure the staff group exists first @@ -35,7 +38,7 @@ RUN mkdir -p /pyrocket_scripts && \ RUN /pyrocket_scripts/install-conda-packages.sh ${REPO_DIR}/environment.yml # Install R, RStudio via Rocker scripts. Requires the prefix for a rocker Dockerfile -RUN /pyrocket_scripts/install-rocker.sh "verse_${R_VERSION}" +RUN R_VERSION_PULL=$R_VERSION_PULL /pyrocket_scripts/install-rocker.sh "verse_${R_VERSION}" # Install extra apt packages # Install linux packages after R installation since the R install scripts get rid of packages From a7f43145c2785f4ba13232a876ca7628ba9f9a9c Mon Sep 17 00:00:00 2001 From: Eli Holmes - NOAA Date: Sun, 24 Nov 2024 09:41:57 -0700 Subject: [PATCH 2/2] Update install-rocker.sh --- scripts/install-rocker.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/install-rocker.sh b/scripts/install-rocker.sh index 1dbd114..a48fb2c 100644 --- a/scripts/install-rocker.sh +++ b/scripts/install-rocker.sh @@ -17,7 +17,7 @@ fi # Check if a filename argument is provided if [ -z "$1" ]; then - echo "Error: install-rocker.sh requires a rocker Dockerfile prefix. Will looke like verse.4.1.1. Exiting." >&2 + echo "Error: install-rocker.sh requires a rocker Dockerfile prefix. Will look like verse.4.1.1. Exiting." >&2 echo "Usage: RUN /pyrocket_scripts/install-conda-packages.sh " >&2 exit 1 fi @@ -34,15 +34,17 @@ R_DOCKERFILE="$1" export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # Copy in the rocker files. Work in ${REPO_DIR} to make sure I don't clobber anything +# R_VERSION_PULL may be different than R_VERSION. Specifically pulling latest but using R_VERSION prior to latest +# So that CRAN repo is pinned to a date. cd ${REPO_DIR} ROCKER_DOCKERFILE_NAME="${R_DOCKERFILE}.Dockerfile" # For degugging use: wget https://github.com/eeholmes/rocker-versioned2/archive/refs/tags/R4.4.1.tar.gz -wget https://github.com/rocker-org/rocker-versioned2/archive/refs/tags/R${R_VERSION}.tar.gz -tar zxvf R${R_VERSION}.tar.gz && \ -mv rocker-versioned2-R${R_VERSION}/scripts /rocker_scripts && \ -mv rocker-versioned2-R${R_VERSION}/dockerfiles/${ROCKER_DOCKERFILE_NAME} /rocker_scripts/original.Dockerfile && \ -rm R${R_VERSION}.tar.gz && \ -rm -rf rocker-versioned2-R${R_VERSION} +wget https://github.com/rocker-org/rocker-versioned2/archive/refs/tags/R${R_VERSION_PULL}.tar.gz +tar zxvf R${R_VERSION_PULL}.tar.gz && \ +mv rocker-versioned2-R${R_VERSION_PULL}/scripts /rocker_scripts && \ +mv rocker-versioned2-R${R_VERSION_PULL}/dockerfiles/${ROCKER_DOCKERFILE_NAME} /rocker_scripts/original.Dockerfile && \ +rm R${R_VERSION_PULL}.tar.gz && \ +rm -rf rocker-versioned2-R${R_VERSION_PULL} cd / # Read the Dockerfile and process each line