Skip to content
Merged
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
12 changes: 12 additions & 0 deletions bakery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ images:
product: workbench
channel: preview
os:
- name: Ubuntu 26.04
platforms:
- linux/amd64
- linux/arm64
- name: Ubuntu 24.04
primary: true
platforms:
Expand All @@ -97,6 +101,10 @@ images:
platforms:
- linux/amd64
- linux/arm64
- name: Ubuntu 26.04
platforms:
- linux/amd64
- linux/arm64
dependencies:
- dependency: R
version: 4.6.1
Expand Down Expand Up @@ -331,6 +339,10 @@ images:
constraint:
latest: true
os:
- name: Ubuntu 26.04
platforms:
- linux/amd64
- linux/arm64
- name: Ubuntu 24.04
primary: true
platforms:
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2025.09/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.01/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.04/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.05/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.06/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.07/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
2 changes: 1 addition & 1 deletion workbench-session-init/2026.08/Containerfile.ubuntu2404
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Initialize PTI in container ###
### Setup environment ###
{{ apt.run_setup() }}

# Download the RStudio Workbench session components
Expand Down
33 changes: 33 additions & 0 deletions workbench-session-init/template/Containerfile.ubuntu2604.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{#-
Below are imports for Bakery's macros. If any are unneeded, they can be removed.
Bakery handles bootstrapping the files into template rendering.
-#}
{%- import "apt.j2" as apt -%}
FROM docker.io/library/ubuntu:26.04 AS builder

ARG DEBIAN_FRONTEND=noninteractive
ARG BUILDARCH
ARG TARGETARCH=${BUILDARCH}

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Setup environment ###
{{ apt.run_setup() }}

# Download the RStudio Workbench session components
RUN case ${TARGETARCH} in \
amd64) CDN_ARCH=x86_64 ;; \
arm64) CDN_ARCH=arm64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \
esac && \
mkdir -p /pwb-staging && \
curl -fsSL -o /pwb-staging/rsp-session-multi-linux.tar.gz "https://s3.amazonaws.com/rstudio-ide-build/session/multi/$CDN_ARCH/rsp-session-multi-linux-{{ Image.Version | replace('+', '-') }}-$CDN_ARCH.tar.gz" && \
mkdir -p /opt/session-components && \
tar -C /opt/session-components -xpf /pwb-staging/rsp-session-multi-linux.tar.gz && \
chmod 755 /opt/session-components && \
rm -rf /pwb-staging

FROM docker.io/library/ubuntu:26.04
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:26.04"
COPY --from=builder /opt/session-components /opt/session-components
CMD ["/opt/session-components/bin/session-init"]
127 changes: 127 additions & 0 deletions workbench-session/matrix/Containerfile.ubuntu2604.min
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Build Python using uv in a separate stage
FROM ghcr.io/astral-sh/uv:debian-slim AS python-builder

ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ENV UV_PYTHON_INSTALL_DIR=/opt/python
ENV UV_PYTHON_PREFERENCE=only-managed

ARG PYTHON_VERSION
RUN uv python install $PYTHON_VERSION
RUN mv /opt/python/cpython-$PYTHON_VERSION-linux-*/ /opt/python/$PYTHON_VERSION


FROM docker.io/library/ubuntu:26.04
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:26.04"

### ARG declarations ###
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILDARCH
ARG TARGETARCH=${BUILDARCH}
ARG R_VERSION
ARG PYTHON_VERSION
ARG QUARTO_VERSION

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Install Apt Packages ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
apt-get dist-upgrade -yqq && \
apt-get autoremove -yqq --purge && \
apt-get install -yqq --no-install-recommends \
curl \
ca-certificates \
gnupg \
tar && \
apt-get install -yqq --no-install-recommends locales && \
localedef -i en_US -f UTF-8 en_US.UTF-8 && \
bash -c "$(curl -1fsSL 'https://dl.posit.co/public/pro/setup.deb.sh')" && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

COPY workbench-session/matrix/deps/ubuntu-26.04_packages.txt /tmp/ubuntu-26.04_packages.txt
RUN apt-get update -yqq && \
xargs -a /tmp/ubuntu-26.04_packages.txt apt-get install -yqq --no-install-recommends && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*

### Install Pro Drivers ###
RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
rstudio-drivers && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*
RUN cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini

### Enable the pwb NSS module for rootless in-session identity resolution ###
# libnss_pwb.so is delivered at runtime by the workbench-session-init container
# into /usr/lib/rstudio-server/bin/resolute/. Create the (build-time dangling)
# multiarch symlink + nsswitch entries so glibc loads it once that volume is
# populated. Dormant-safe: with no workbench-nss.conf the module returns
# Unavail and resolution falls through to `files`.
RUN case "${TARGETARCH}" in \
amd64) TRIPLET=x86_64-linux-gnu ;; \
arm64) TRIPLET=aarch64-linux-gnu ;; \
*) echo "unsupported arch ${TARGETARCH}"; exit 1 ;; \
esac && \
mkdir -p /usr/lib/rstudio-server/bin/resolute && \
touch /usr/lib/rstudio-server/bin/resolute/libnss_pwb.so && \
ln -sf /usr/lib/rstudio-server/bin/resolute/libnss_pwb.so \
"/usr/lib/${TRIPLET}/libnss_pwb.so.2" && \
for db in passwd group shadow; do \
touch /etc/nsswitch.conf; \
if grep -qE "^${db}:" /etc/nsswitch.conf; then \
sed -i -E "/^${db}:/ {/\bpwb\b/! s/\$/ pwb/}" /etc/nsswitch.conf; \
else \
echo "${db}: files pwb" >> /etc/nsswitch.conf; \
fi; \
done

# Install Python from previous stage
COPY --from=python-builder /opt/python /opt/python

### Install Jupyter ###
RUN /opt/python/$PYTHON_VERSION/bin/python -m venv /opt/python/jupyter && \
/opt/python/jupyter/bin/pip install --no-cache-dir --upgrade pip setuptools wheel && \
/opt/python/jupyter/bin/pip install --no-cache-dir --upgrade \
"jupyterlab<5" \
notebook \
"pwb_jupyterlab<2" && \
rm -rf /opt/python/jupyter/lib/python*/site-packages/jupyterlab/tests && \
rm -rf /opt/python/jupyter/lib/python*/site-packages/jupyterlab/galata && \
rm -f /opt/python/jupyter/lib/python*/site-packages/jupyterlab/staging/yarn.lock && \
ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter

### Install Jupyter kernel ###
RUN /opt/python/$PYTHON_VERSION/bin/pip install --no-cache-dir --upgrade --break-system-packages \
ipykernel && \
/opt/python/$PYTHON_VERSION/bin/python -m ipykernel install --user --name python$PYTHON_VERSION --display-name "Python $PYTHON_VERSION"

# Install R
RUN RUN_UNATTENDED=1 R_VERSION=$R_VERSION bash -c "$(curl -fsSL https://rstd.io/r-install)" && \
find . -type f -name '[rR]-$R_VERSION.*\.(deb|rpm)' -delete

### Install Quarto ###
RUN bash -c "$(curl -1fsSL 'https://dl.posit.co/public/open/setup.deb.sh')" && \
apt-get install -yqq --no-install-recommends \
quarto=$QUARTO_VERSION && \
apt-mark hold quarto && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*

### Install TinyTeX ###
# ADD busts the cache on new TinyTeX releases.
# HOME="/opt" workaround: https://github.com/quarto-dev/quarto-cli/issues/11800
ADD https://github.com/rstudio/tinytex-releases/releases/latest /tmp/tinytex-release.json
RUN --mount=type=secret,id=github_token,required=false \
GH_TOKEN="$([ -s /run/secrets/github_token ] && cat /run/secrets/github_token)" HOME="/opt" CI=true /opt/quarto/bin/quarto install tinytex --no-prompt --update-path && \
rm -f /tmp/tinytex-release.json

COPY workbench-session/matrix/conf/vscode.extensions.conf /etc/rstudio/vscode.extensions.conf
COPY workbench-session/matrix/conf/positron.extensions.conf /etc/rstudio/positron.extensions.conf

EXPOSE 8788/tcp
130 changes: 130 additions & 0 deletions workbench-session/matrix/Containerfile.ubuntu2604.std
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Build Python using uv in a separate stage
FROM ghcr.io/astral-sh/uv:debian-slim AS python-builder

ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
ENV UV_PYTHON_INSTALL_DIR=/opt/python
ENV UV_PYTHON_PREFERENCE=only-managed

ARG PYTHON_VERSION
RUN uv python install $PYTHON_VERSION
RUN mv /opt/python/cpython-$PYTHON_VERSION-linux-*/ /opt/python/$PYTHON_VERSION


FROM docker.io/library/ubuntu:26.04
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:26.04"

### ARG declarations ###
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILDARCH
ARG TARGETARCH=${BUILDARCH}
ARG R_VERSION
ARG PYTHON_VERSION
ARG QUARTO_VERSION

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

### Install Apt Packages ###
RUN echo 'Acquire::Retries "3"; Acquire::http::Timeout "30"; Acquire::https::Timeout "30";' > /etc/apt/apt.conf.d/99-retries && \
apt-get update -yqq --fix-missing && \
apt-get upgrade -yqq && \
apt-get dist-upgrade -yqq && \
apt-get autoremove -yqq --purge && \
apt-get install -yqq --no-install-recommends \
curl \
ca-certificates \
gnupg \
tar && \
apt-get install -yqq --no-install-recommends locales && \
localedef -i en_US -f UTF-8 en_US.UTF-8 && \
bash -c "$(curl -1fsSL 'https://dl.posit.co/public/pro/setup.deb.sh')" && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

COPY workbench-session/matrix/deps/ubuntu-26.04_packages.txt /tmp/ubuntu-26.04_packages.txt
COPY workbench-session/matrix/deps/ubuntu-26.04_optional_packages.txt /tmp/ubuntu-26.04_optional_packages.txt
RUN apt-get update -yqq && \
xargs -a /tmp/ubuntu-26.04_packages.txt apt-get install -yqq --no-install-recommends && \
xargs -a /tmp/ubuntu-26.04_optional_packages.txt apt-get install -yqq --no-install-recommends && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*


### Install Pro Drivers ###
RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
rstudio-drivers && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*
RUN cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini

### Enable the pwb NSS module for rootless in-session identity resolution ###
# libnss_pwb.so is delivered at runtime by the workbench-session-init container
# into /usr/lib/rstudio-server/bin/resolute/. Create the (build-time dangling)
# multiarch symlink + nsswitch entries so glibc loads it once that volume is
# populated. Dormant-safe: with no workbench-nss.conf the module returns
# Unavail and resolution falls through to `files`.
RUN case "${TARGETARCH}" in \
amd64) TRIPLET=x86_64-linux-gnu ;; \
arm64) TRIPLET=aarch64-linux-gnu ;; \
*) echo "unsupported arch ${TARGETARCH}"; exit 1 ;; \
esac && \
mkdir -p /usr/lib/rstudio-server/bin/resolute && \
touch /usr/lib/rstudio-server/bin/resolute/libnss_pwb.so && \
ln -sf /usr/lib/rstudio-server/bin/resolute/libnss_pwb.so \
"/usr/lib/${TRIPLET}/libnss_pwb.so.2" && \
for db in passwd group shadow; do \
touch /etc/nsswitch.conf; \
if grep -qE "^${db}:" /etc/nsswitch.conf; then \
sed -i -E "/^${db}:/ {/\bpwb\b/! s/\$/ pwb/}" /etc/nsswitch.conf; \
else \
echo "${db}: files pwb" >> /etc/nsswitch.conf; \
fi; \
done

# Install Python from previous stage
COPY --from=python-builder /opt/python /opt/python

### Install Jupyter ###
RUN /opt/python/$PYTHON_VERSION/bin/python -m venv /opt/python/jupyter && \
/opt/python/jupyter/bin/pip install --no-cache-dir --upgrade pip setuptools wheel && \
/opt/python/jupyter/bin/pip install --no-cache-dir --upgrade \
"jupyterlab<5" \
notebook \
"pwb_jupyterlab<2" && \
rm -rf /opt/python/jupyter/lib/python*/site-packages/jupyterlab/tests && \
rm -rf /opt/python/jupyter/lib/python*/site-packages/jupyterlab/galata && \
rm -f /opt/python/jupyter/lib/python*/site-packages/jupyterlab/staging/yarn.lock && \
ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter

### Install Jupyter kernel ###
RUN /opt/python/$PYTHON_VERSION/bin/pip install --no-cache-dir --upgrade --break-system-packages \
ipykernel && \
/opt/python/$PYTHON_VERSION/bin/python -m ipykernel install --user --name python$PYTHON_VERSION --display-name "Python $PYTHON_VERSION"

# Install R
RUN RUN_UNATTENDED=1 R_VERSION=$R_VERSION bash -c "$(curl -fsSL https://rstd.io/r-install)" && \
find . -type f -name '[rR]-$R_VERSION.*\.(deb|rpm)' -delete

### Install Quarto ###
RUN bash -c "$(curl -1fsSL 'https://dl.posit.co/public/open/setup.deb.sh')" && \
apt-get install -yqq --no-install-recommends \
quarto=$QUARTO_VERSION && \
apt-mark hold quarto && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*

### Install TinyTeX ###
# ADD busts the cache on new TinyTeX releases.
# HOME="/opt" workaround: https://github.com/quarto-dev/quarto-cli/issues/11800
ADD https://github.com/rstudio/tinytex-releases/releases/latest /tmp/tinytex-release.json
RUN --mount=type=secret,id=github_token,required=false \
GH_TOKEN="$([ -s /run/secrets/github_token ] && cat /run/secrets/github_token)" HOME="/opt" CI=true /opt/quarto/bin/quarto install tinytex --no-prompt --update-path && \
rm -f /tmp/tinytex-release.json

COPY workbench-session/matrix/conf/vscode.extensions.conf /etc/rstudio/vscode.extensions.conf
COPY workbench-session/matrix/conf/positron.extensions.conf /etc/rstudio/positron.extensions.conf

EXPOSE 8788/tcp
Loading
Loading