From c5c250d897c93968ead1b7b1dd6d9cef2cd7a019 Mon Sep 17 00:00:00 2001 From: Nick Pelikan Date: Wed, 8 Nov 2023 15:07:43 -0700 Subject: [PATCH 1/4] adding customer-submitted RL9 images --- product/base/Dockerfile.rl9 | 106 ++++++++++++++++++++++++++++++ product/pro/Dockerfile.rl9 | 28 ++++++++ r-session-complete/Dockerfile.rl9 | 50 ++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 product/base/Dockerfile.rl9 create mode 100644 product/pro/Dockerfile.rl9 create mode 100644 r-session-complete/Dockerfile.rl9 diff --git a/product/base/Dockerfile.rl9 b/product/base/Dockerfile.rl9 new file mode 100644 index 00000000..f8e8d3e0 --- /dev/null +++ b/product/base/Dockerfile.rl9 @@ -0,0 +1,106 @@ +FROM rockylinux:9 +LABEL maintainer="Posit " + +### ARG declarations ### +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG TINI_VERSION=0.19.0 +ARG QUARTO_VERSION=1.3.340 + +### Update/upgrade system packages ### +RUN dnf install -y -q dnf-plugins-core \ + && dnf config-manager --enable crb \ + && dnf upgrade -y -q \ + && dnf install -y -q \ + epel-release \ + && dnf install -y -q \ + bzip2 \ + git \ + glibc-common \ + glibc-langpack-en \ + glibc-locale-source \ + gpgme \ + gpgmepp \ + libcurl-devel \ + libuser-devel \ + libxml2-devel \ + openssl-devel \ + openssh-clients \ + pandoc \ + perl-Digest-MD5 \ + postgresql-libs \ + rrdtool \ + sudo \ + unixODBC \ + unixODBC-devel \ + wget \ + which \ + && dnf clean all + +### Install tini ### +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64 /tini +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64.asc /tini.asc +RUN gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ + && gpg --batch --verify /tini.asc /tini \ + && chmod +x /tini \ + && ln -s /tini /usr/local/bin/tini + +### Install TinyTeX ### +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \ + && /root/.TinyTeX/bin/*/tlmgr path remove \ + && mv /root/.TinyTeX/ /opt/TinyTeX \ + && /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \ + && /opt/TinyTeX/bin/*/tlmgr path add + +### Install Quarto ### +RUN curl -o quarto.tar.gz -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz \ + && mkdir -p /opt/quarto/${QUARTO_VERSION} \ + && tar -zxvf quarto.tar.gz -C "/opt/quarto/${QUARTO_VERSION}" --strip-components=1 \ + && rm -f quarto.tar.gz \ + && ln -s /opt/quarto/${QUARTO_VERSION}/bin/quarto /usr/local/bin/quarto + +### Install R versions ### +RUN curl -O https://cdn.rstudio.com/r/rhel-9/pkgs/R-${R_VERSION}-1-1.x86_64.rpm \ + && curl -O https://cdn.rstudio.com/r/rhel-9/pkgs/R-${R_VERSION_ALT}-1-1.x86_64.rpm \ + && dnf install -y R-${R_VERSION}-1-1.x86_64.rpm \ + && dnf install -y R-${R_VERSION_ALT}-1-1.x86_64.rpm \ + && dnf clean all \ + && rm -rf R-${R_VERSION}-1-1.x86_64.rpm \ + && rm -rf R-${R_VERSION_ALT}-1-1.x86_64.rpm \ + && ln -s /opt/R/${R_VERSION} /opt/R/default \ + && ln -s /opt/R/default/bin/R /usr/local/bin/R \ + && ln -s /opt/R/default/bin/Rscript /usr/local/bin/Rscript + +### Install Python versions ### +RUN curl -O https://cdn.rstudio.com/python/rhel-9/pkgs/python-${PYTHON_VERSION}-1-1.x86_64.rpm \ + && curl -O https://cdn.rstudio.com/python/rhel-9/pkgs/python-${PYTHON_VERSION_ALT}-1-1.x86_64.rpm \ + && dnf install -y python-${PYTHON_VERSION}-1-1.x86_64.rpm \ + && dnf install -y python-${PYTHON_VERSION_ALT}-1-1.x86_64.rpm \ + && dnf clean all \ + && rm -rf python-${PYTHON_VERSION}-1-1.x86_64.rpm \ + && rm -rf python-${PYTHON_VERSION_ALT}-1-1.x86_64.rpm \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install 'virtualenv<20' \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade setuptools \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install 'virtualenv<20' \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade setuptools \ + && ln -s /opt/python/${PYTHON_VERSION} /opt/python/default + +### Locale configuration ### +RUN localedef -i en_US -f UTF-8 en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + + +LABEL posit.r.version="${R_VERSION}" \ + posit.r.version_alt="${R_VERSION_ALT}" \ + posit.python.version="${PYTHON_VERSION}" \ + posit.python.version_alt="${PYTHON_VERSION_ALT}" \ + posit.tini.version="${TINI_VERSION}" \ + posit.quarto.version="${QUARTO_VERSION}" \ + rstudio.pro-drivers.version="${DRIVERS_VERSION}" + +ENTRYPOINT ["/tini", "--"] diff --git a/product/pro/Dockerfile.rl9 b/product/pro/Dockerfile.rl9 new file mode 100644 index 00000000..e590a22a --- /dev/null +++ b/product/pro/Dockerfile.rl9 @@ -0,0 +1,28 @@ +### ARG declarations ### +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG SRC_IMAGE_NAME=product-base +ARG REGISTRY=ghcr.io +FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rl9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} +LABEL maintainer="Posit Docker " + +### ARG declarations ### +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG DRIVERS_VERSION=2023.05.0-1 + +### Install professional drivers +RUN curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm \ + && dnf install -y ./rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm \ + && dnf clean all \ + && rm -f rstudio-drivers-${DRIVERS_VERSION}.el7.x86_64.rpm \ + && cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini \ + && "/opt/R/${R_VERSION}/bin/R" -e 'install.packages("odbc", repos="https://packagemanager.rstudio.com/cran/__linux__/rhel9/latest")' + +LABEL rstudio.pro-drivers.version="${DRIVERS_VERSION}" + +ENTRYPOINT ["/tini", "--"] diff --git a/r-session-complete/Dockerfile.rl9 b/r-session-complete/Dockerfile.rl9 new file mode 100644 index 00000000..2b64c163 --- /dev/null +++ b/r-session-complete/Dockerfile.rl9 @@ -0,0 +1,50 @@ +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG SRC_IMAGE_NAME=product-base-pro +ARG REGISTRY=ghcr.io +FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rl9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} +LABEL maintainer="RStudio Docker " + +### ARG declarations ### +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG JUPYTERLAB_VERSION=3.2.9 +ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/rhel9/x86_64/rstudio-workbench-rhel-2023.09.1-x86_64.rpm + +### Install RSW +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN dnf install -y subversion \ + && curl -o rstudio-workbench.rpm "${RSW_DOWNLOAD_URL}" \ + && gpg --keyserver hkps://keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \ + && gpg --export --armor 51C0B5BB19F92D60 > rstudio-signing.key \ + && rpm --import rstudio-signing.key \ + && rpm -K rstudio-workbench.rpm \ + && dnf install -y rstudio-workbench.rpm \ + && rm rstudio-workbench.rpm \ + && dnf clean all \ + && rm -rf /var/lib/rstudio-server/r-versions + +### Install jupyter +RUN /opt/python/"${PYTHON_VERSION}"/bin/pip3 install \ + jupyter \ + jupyterlab=="${JUPYTERLAB_VERSION}" \ + rsconnect_jupyter \ + rsconnect_python \ + rsp_jupyter \ + workbench_jupyterlab \ + && ln -s /opt/python/"${PYTHON_VERSION}"/bin/jupyter /usr/local/bin/jupyter \ + && /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \ + && /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \ + && /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \ + && /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \ + && /opt/python/"${PYTHON_VERSION}"/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter + +ENV PATH="/opt/python/${PYTHON_VERSION}/bin:${PATH}" + +COPY vscode.extensions.conf /etc/rstudio/vscode.extensions.conf + +EXPOSE 8788/tcp From 0c0203b7062c8e7bb2a85fad20b1e575ea7feb09 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 21 Nov 2023 10:58:11 -0800 Subject: [PATCH 2/4] Rename from rl9 to rockylinux9 --- product/base/{Dockerfile.rl9 => Dockerfile.rockylinux9} | 4 +++- product/pro/{Dockerfile.rl9 => Dockerfile.rockylinux9} | 4 +++- r-session-complete/{Dockerfile.rl9 => Dockerfile.rockylinux9} | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) rename product/base/{Dockerfile.rl9 => Dockerfile.rockylinux9} (96%) rename product/pro/{Dockerfile.rl9 => Dockerfile.rockylinux9} (80%) rename r-session-complete/{Dockerfile.rl9 => Dockerfile.rockylinux9} (89%) diff --git a/product/base/Dockerfile.rl9 b/product/base/Dockerfile.rockylinux9 similarity index 96% rename from product/base/Dockerfile.rl9 rename to product/base/Dockerfile.rockylinux9 index f8e8d3e0..d0e76f0d 100644 --- a/product/base/Dockerfile.rl9 +++ b/product/base/Dockerfile.rockylinux9 @@ -1,5 +1,7 @@ +# NOTE: This Dockerfile has been provided by the community and is not officially built or supported by Posit. + FROM rockylinux:9 -LABEL maintainer="Posit " +LABEL maintainer="Posit Docker " ### ARG declarations ### ARG R_VERSION=4.2.3 diff --git a/product/pro/Dockerfile.rl9 b/product/pro/Dockerfile.rockylinux9 similarity index 80% rename from product/pro/Dockerfile.rl9 rename to product/pro/Dockerfile.rockylinux9 index e590a22a..94eb6ab9 100644 --- a/product/pro/Dockerfile.rl9 +++ b/product/pro/Dockerfile.rockylinux9 @@ -1,3 +1,5 @@ +# NOTE: This Dockerfile has been provided by the community and is not officially built or supported by Posit. + ### ARG declarations ### ARG R_VERSION=4.2.3 ARG R_VERSION_ALT=4.1.3 @@ -5,7 +7,7 @@ ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG SRC_IMAGE_NAME=product-base ARG REGISTRY=ghcr.io -FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rl9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} +FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rockylinux9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} LABEL maintainer="Posit Docker " ### ARG declarations ### diff --git a/r-session-complete/Dockerfile.rl9 b/r-session-complete/Dockerfile.rockylinux9 similarity index 89% rename from r-session-complete/Dockerfile.rl9 rename to r-session-complete/Dockerfile.rockylinux9 index 2b64c163..5c0e91cd 100644 --- a/r-session-complete/Dockerfile.rl9 +++ b/r-session-complete/Dockerfile.rockylinux9 @@ -1,10 +1,12 @@ +# NOTE: This Dockerfile has been provided by the community and is not officially built or supported by Posit. + ARG R_VERSION=4.2.3 ARG R_VERSION_ALT=4.1.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG SRC_IMAGE_NAME=product-base-pro ARG REGISTRY=ghcr.io -FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rl9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} +FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:rockylinux9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} LABEL maintainer="RStudio Docker " ### ARG declarations ### From 113225954bece8ddc5f05e1e8574ce33c8fd81c6 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 21 Nov 2023 11:00:02 -0800 Subject: [PATCH 3/4] Goss and justfile fixes --- product/base/Justfile | 2 +- product/base/test/goss.yaml | 2 +- product/pro/Justfile | 2 +- product/pro/test/goss.yaml | 2 +- r-session-complete/Justfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/product/base/Justfile b/product/base/Justfile index 00c60378..be666ff6 100755 --- a/product/base/Justfile +++ b/product/base/Justfile @@ -35,7 +35,7 @@ build OS=IMAGE_OS *TAGS="": fi tag_array=() - for TAG in {{TAGS}} + for TAG in $raw_tag_array do tag_array+=("-t" $TAG) done diff --git a/product/base/test/goss.yaml b/product/base/test/goss.yaml index 18e338a5..c62d04b8 100644 --- a/product/base/test/goss.yaml +++ b/product/base/test/goss.yaml @@ -7,7 +7,7 @@ package: cracklib-runtime: installed: true {{end}} - {{if .Env.OS | regexMatch "centos.*"}} + {{if .Env.OS | regexMatch "(centos|rockylinux).*"}} epel-release: installed: true gnupg2: diff --git a/product/pro/Justfile b/product/pro/Justfile index 354c6546..e7eeb4ac 100644 --- a/product/pro/Justfile +++ b/product/pro/Justfile @@ -37,7 +37,7 @@ build OS=IMAGE_OS *TAGS="": raw_tag_array=("{{TAGS}}") fi - if [[ "{{ OS }}" == "centos7" ]]; then + if [[ "{{ OS }}" == "centos7" ]] || [[ "{{ OS }}" == "rockylinux9" ]]; then _DRIVERS_VERSION="{{ DRIVERS_VERSION_RHEL }}" else _DRIVERS_VERSION="{{ DRIVERS_VERSION }}" diff --git a/product/pro/test/goss.yaml b/product/pro/test/goss.yaml index 53ea2a34..5b3e6e8d 100644 --- a/product/pro/test/goss.yaml +++ b/product/pro/test/goss.yaml @@ -9,7 +9,7 @@ package: unixodbc-dev: installed: true {{end}} - {{if .Env.OS | regexMatch "centos.*"}} + {{if .Env.OS | regexMatch "(centos|rockylinux9).*"}} epel-release: installed: true gnupg2: diff --git a/r-session-complete/Justfile b/r-session-complete/Justfile index c58b0cae..f674d311 100755 --- a/r-session-complete/Justfile +++ b/r-session-complete/Justfile @@ -29,7 +29,7 @@ build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": if [[ "{{BUILDX_PATH}}" != "" ]]; then BUILDX_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache" fi - if [[ "{{ OS }}" == "centos7" ]]; then + if [[ "{{ OS }}" == "centos7" ]] || [[ "{{ OS }}" == "rocklinux9" ]]; then _DRIVERS_VERSION="{{ DRIVERS_VERSION_RHEL }}" else _DRIVERS_VERSION="{{ DRIVERS_VERSION }}" From 2dd06a9af728087acda78538426587df1e3c7738 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 21 Nov 2023 11:00:12 -0800 Subject: [PATCH 4/4] Add note to NEWS.md --- r-session-complete/NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r-session-complete/NEWS.md b/r-session-complete/NEWS.md index 77917139..7f574650 100644 --- a/r-session-complete/NEWS.md +++ b/r-session-complete/NEWS.md @@ -1,3 +1,7 @@ +# 2023.11.21 +- Added `Dockerfile.rockylinux9`, a community contribution! + - *NOTE: This image is not officially built or supported by Posit at this time.* + # 2023.03.1 - Update Python VSCode extension to version 2023.6.1