Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocky 9 dockerfiles for PWB (customer submitted!) #659

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions product/base/Dockerfile.rockylinux9
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# NOTE: This Dockerfile has been provided by the community and is not officially built or supported by Posit.

FROM rockylinux:9
LABEL maintainer="Posit Docker <[email protected]>"

### 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", "--"]
2 changes: 1 addition & 1 deletion product/base/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion product/base/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 30 additions & 0 deletions product/pro/Dockerfile.rockylinux9
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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
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}:rockylinux9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT}
LABEL maintainer="Posit Docker <[email protected]>"

### 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", "--"]
2 changes: 1 addition & 1 deletion product/pro/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion product/pro/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
52 changes: 52 additions & 0 deletions r-session-complete/Dockerfile.rockylinux9
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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}:rockylinux9-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT}
LABEL maintainer="RStudio Docker <[email protected]>"

### 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
2 changes: 1 addition & 1 deletion r-session-complete/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
4 changes: 4 additions & 0 deletions r-session-complete/NEWS.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading