Skip to content
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
8 changes: 8 additions & 0 deletions bakery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ images:
buildSecrets:
- id: github_token
envVar: GITHUB_TOKEN
variants:
- name: Standard
extension: std
tagDisplayName: std
primary: true
- name: Minimal
extension: min
tagDisplayName: min
matrix:
namePattern: "R{{ Dependencies.R }}-python{{ Dependencies.python }}"
dependencyConstraints:
Expand Down
25 changes: 20 additions & 5 deletions workbench-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ Posit publishes images to:
- Docker Hub: `docker.io/posit/workbench-session`
- GitHub Container Registry: `ghcr.io/posit-dev/workbench-session`

Ubuntu 24.04 is the default OS.
Ubuntu 24.04 is the default OS. The Standard (`std`) variant is the default; tags without a variant suffix resolve to it.

The tag format is: `R{r_version}-python{python_version}-{os}`
The tag format is: `R{r_version}-python{python_version}-{os}[-{variant}]`

Examples:
- `R4.5.2-python3.14.3-ubuntu-24.04` — R 4.5.2, Python 3.14.3, Ubuntu 24.04
- `R4.4.3-python3.12.12-ubuntu-22.04` — R 4.4.3, Python 3.12.12, Ubuntu 22.04
- `R4.3.3-python3.11.15-ubuntu-24.04` — R 4.3.3, Python 3.11.15, Ubuntu 24.04
- `R4.5.2-python3.14.3-ubuntu-24.04` — R 4.5.2, Python 3.14.3, Ubuntu 24.04, standard variant
- `R4.5.2-python3.14.3-ubuntu-24.04-std` — Explicit standard variant
- `R4.5.2-python3.14.3-ubuntu-24.04-min` — Minimal variant
- `R4.4.3-python3.12.12-ubuntu-22.04` — R 4.4.3, Python 3.12.12, Ubuntu 22.04, standard variant
- `R4.3.3-python3.11.15-ubuntu-24.04` — R 4.3.3, Python 3.11.15, Ubuntu 24.04, standard variant

## Architectures

Expand All @@ -86,6 +88,19 @@ Each image includes:

These images do not bundle the Workbench session components themselves. The `workbench-session-init` init container provides those components at runtime through a shared volume.

## Image variants

Two variants are available:

| Variant | Description |
|---|---|
| Standard (`std`) | Opinionated image, runs out of the box. Bundles R, Python, Jupyter, Quarto, TinyTeX, and Posit Professional Drivers, plus a curated set of system development libraries that cover the most commonly used CRAN and PyPI packages. |
| Minimal (`min`) | Same runtime stack as Standard (R, Python, Jupyter, Quarto, TinyTeX, Posit Professional Drivers) without the additional system development libraries. Use this variant as a starting point for custom images when you want to control which system libraries are present. |

Both variants ship the same R, Python, Jupyter, Quarto, TinyTeX, and Posit Professional Drivers versions for a given tag. The Containerfiles in this repository under `workbench-session/matrix/` document the exact packages installed in any tag.

See [extending examples](https://github.com/posit-dev/images-examples/tree/main/extending) for how to build on the Minimal image.

## User

These images do not declare a `USER`. Containers start as `root`. The Workbench Job Launcher manages the runtime user when scheduling session pods, dropping privileges to the signed-in user as configured by the Workbench administrator.
Expand Down
101 changes: 101 additions & 0 deletions workbench-session/matrix/Containerfile.ubuntu2204.std
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 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:22.04
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:22.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 && \
bash -c "$(curl -1fsSL 'https://dl.posit.co/public/pro/setup.deb.sh')" && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*

COPY workbench-session/matrix/deps/ubuntu-22.04_packages.txt /tmp/ubuntu-22.04_packages.txt
COPY workbench-session/matrix/deps/ubuntu-22.04_optional_packages.txt /tmp/ubuntu-22.04_optional_packages.txt
RUN apt-get update -yqq && \
xargs -a /tmp/ubuntu-22.04_packages.txt apt-get install -yqq --no-install-recommends && \
xargs -a /tmp/ubuntu-22.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

# 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" /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
101 changes: 101 additions & 0 deletions workbench-session/matrix/Containerfile.ubuntu2404.std
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 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:24.04
LABEL org.opencontainers.image.base.name="docker.io/library/ubuntu:24.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 && \
bash -c "$(curl -1fsSL 'https://dl.posit.co/public/pro/setup.deb.sh')" && \
apt-get clean -yqq && \
rm -rf /var/lib/apt/lists/*

COPY workbench-session/matrix/deps/ubuntu-24.04_packages.txt /tmp/ubuntu-24.04_packages.txt
COPY workbench-session/matrix/deps/ubuntu-24.04_optional_packages.txt /tmp/ubuntu-24.04_optional_packages.txt
RUN apt-get update -yqq && \
xargs -a /tmp/ubuntu-24.04_packages.txt apt-get install -yqq --no-install-recommends && \
xargs -a /tmp/ubuntu-24.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

# 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" /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
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
autoconf
automake
cmake
gfortran
make
patch
pkg-config
bzip2
unzip
zip
libbz2-dev
liblzma-dev
zlib1g-dev
libcurl4-openssl-dev
libsodium-dev
libssh2-1-dev
libffi-dev
libpcre2-dev
libreadline-dev
libicu-dev
libxml2-dev
libxslt1-dev
default-libmysqlclient-dev
libsqlite3-dev
unixodbc-dev
libgit2-dev
openssh-client
wget
gdal-bin
libgdal-dev
libgeos-dev
libproj-dev
libudunits2-dev
fonts-dejavu-core
fonts-liberation
ghostscript
gsfonts
imagemagick
libcairo2-dev
libfontconfig1-dev
libfreetype6-dev
libfribidi-dev
libharfbuzz-dev
libjpeg-dev
libmagick++-dev
libpango1.0-dev
libpng-dev
libtiff-dev
libwebp-dev
libglpk-dev
libgmp3-dev
libgsl-dev
libmpfr-dev
libabsl-dev
libnode-dev
libprotobuf-dev
libprotoc-dev
libuv1-dev
protobuf-compiler
libpoppler-cpp-dev
poppler-data
poppler-utils
libgl1-mesa-dev
libglu1-mesa-dev
libx11-dev
tcl
tk
tk-dev
tk-table
default-jdk
libkrb5-dev
libldap2-dev
libsasl2-dev
gdb
perl
strace
1 change: 0 additions & 1 deletion workbench-session/matrix/deps/ubuntu-22.04_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ krb5-user
libpq-dev
libuser
libuser1-dev
libuv1-dev
rrdtool
subversion
xz-utils
Loading
Loading