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
30 changes: 23 additions & 7 deletions .github/workflows/extending.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ jobs:
run: |
set -euo pipefail

# Find directories under extending that contain Dockerfile or Containerfile
entries=$(find extending -type f -name "Containerfile*" -o -name "Dockerfile*" | while read -r f; do
dir=$(dirname "$f")
name="${dir#extending/}"
containerfile=$(basename "$f")
echo "$name,$dir,$containerfile"
done | jq -R -s -c 'split("\n")[:-1] | map(split(",")) | map({name: .[0], directory: .[1], file: .[2]})')
# Plain extending examples: one entry per Containerfile or Dockerfile.
# Skip directories with a bakery.yaml — those are handled by the
# `bakery` job below via the shared bakery-build-pr workflow.
entries=$(
for dir in extending/*/; do
example_root=${dir%/}
[ -f "${example_root}/bakery.yaml" ] && continue
base=$(basename "$dir")
while IFS= read -r f; do
containerfile_dir=$(dirname "$f")
echo "${base},${containerfile_dir},$(basename "$f")"
done < <(find "$example_root" -type f \( -name "Containerfile*" -o -name "Dockerfile*" \))
done | jq -R -s -c 'split("\n")[:-1] | map(split(",")) | map({name: .[0], directory: .[1], file: .[2]})'
)

# Create the matrix JSON in one step to avoid shell quoting issues
matrix=$(echo "$entries" | jq -c '{include: .}')
Expand Down Expand Up @@ -70,3 +77,12 @@ jobs:
push: false
context: ${{ matrix.directory }}
file: ${{ matrix.directory }}/${{ matrix.file }}

bakery:
name: Build with Bakery
permissions:
contents: read
packages: write
uses: posit-dev/images-shared/.github/workflows/bakery-build-pr.yml@main
with:
context: extending/posit-team
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Are you customizing one image or managing many?

- [Bakery](./bakery/): The Posit [templating system](https://github.com/posit-dev/images-shared/tree/main/posit-bakery) for managing matrices of container images across multiple R versions, Python versions, OS variants, and product versions. Use Bakery to maintain a fleet of custom images and rebuild them consistently. Posit uses the same tool to build the official product images.

- [Fleet extension example](./extending/posit-team/): Manage customized Workbench, Connect, and Package Manager images together in one Bakery project.

Looking for something else?

| Goal | Where to go |
Expand Down
2 changes: 2 additions & 0 deletions bakery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Posit Bakery is the Jinja2-based templating system from Posit for managing conta
| [05-images-with-managed-dependencies](./05-images-with-managed-dependencies/) | Automatic version management of R, Python, and Quarto using dependency constraints |
| [06-matrix-images](./06-matrix-images/) | Build multiple image variants from dependency combinations using Docker build arguments |

For a recipe that uses Bakery to manage a fleet of customized Posit product images, see [`extending/posit-team`](../extending/posit-team/).

## Additional resources

### Posit Bakery documentation and resources
Expand Down
49 changes: 25 additions & 24 deletions extending/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,38 @@

Posit product images are published in two variants:

- **Standard** (`std`) — Includes pre-installed versions of Python, R, and Quarto
- **Minimal** (`min`) — A lightweight base image without pre-installed languages, intended to be extended
- **Standard** (`std`): Includes pre-installed versions of Python, R, and Quarto
- **Minimal** (`min`): A lightweight base image without pre-installed languages, intended to be extended

Product images are available on [Docker Hub](https://hub.docker.com/u/posit):

- [`posit/connect`](https://hub.docker.com/r/posit/connect) — [Posit Connect](https://github.com/posit-dev/images-connect)
- [`posit/connect-content`](https://hub.docker.com/r/posit/connect-content) — [Posit Connect content runtime](https://github.com/posit-dev/images-connect)
- [`posit/package-manager`](https://hub.docker.com/r/posit/package-manager) — [Posit Package Manager](https://github.com/posit-dev/images-package-manager)
- [`posit/workbench`](https://hub.docker.com/r/posit/workbench) — [Posit Workbench](https://github.com/posit-dev/images-workbench)
- [`posit/workbench-session`](https://hub.docker.com/r/posit/workbench-session) — [Posit Workbench session runtime](https://github.com/posit-dev/images-workbench)
- [`posit/connect`](https://hub.docker.com/r/posit/connect): [Posit Connect](https://github.com/posit-dev/images-connect)
- [`posit/connect-content`](https://hub.docker.com/r/posit/connect-content): [Posit Connect content runtime](https://github.com/posit-dev/images-connect)
- [`posit/package-manager`](https://hub.docker.com/r/posit/package-manager): [Posit Package Manager](https://github.com/posit-dev/images-package-manager)
- [`posit/workbench`](https://hub.docker.com/r/posit/workbench): [Posit Workbench](https://github.com/posit-dev/images-workbench)
- [`posit/workbench-session`](https://hub.docker.com/r/posit/workbench-session): [Posit Workbench session runtime](https://github.com/posit-dev/images-workbench)

> [!NOTE]
> For an alternative approach that uses the Bakery CLI to manage extended images as a project, see the [bakery examples](../bakery/).
## Built with Bakery

## Examples

Examples are organized by product. Within each product folder a `README.md` explains which image to customize for different goals.

| Path | Contents |
|:-----|:---------|
| [common](./common/) | Patterns that apply to any Posit product image |
| [workbench](./workbench/) | Examples for Posit Workbench images — with a guide to choosing the right image |
| [connect](./connect/) | Examples for Posit Connect images — with a guide to choosing the right image |

### Common examples
These use [Bakery](../bakery/) to template and manage image definitions, typically across several Posit products or several versions at once. The rendered Containerfiles are committed alongside the templates, so a build does not require Bakery: `docker build` against the rendered file works the same way the static examples do.

| Path | Example |
|:-----|:--------|
| [common/ca-certificates](./common/ca-certificates/) | Add a custom CA certificate to the system trust store |
| [common/R](./common/R/) | Install specific versions of R and R packages |
| [common/python](./common/python/) | Install specific versions of Python and Python packages |
| [common/system-dependencies](./common/system-dependencies/) | Install system libraries required by R or Python packages |
| [posit-team](./posit-team/) | Manage a fleet of customized Workbench, Connect, and Package Manager images with shared R and Python pins |

## Static image definitions

Examples are organized by product. Within each product folder, a `README.md` explains which image to customize for different goals.

| Path | Base product | Example |
|:-----|:-------------|:--------|
| [common/ca-certificates](./common/ca-certificates/) | Any | Add a custom CA certificate to the system trust store |
| [pip-conf](./pip-conf/) | Posit Connect | Add a custom `pip.conf` file to specify global pip settings |
| [pro-drivers](./pro-drivers/) | Posit Workbench | Install the Posit Pro Drivers (ODBC drivers) on a minimal product image |
| [common/python](./common/python/) | Any | Install specific versions of Python on a minimal product image<br/>Install a list of Python packages in each Python version |
| [quarto](./quarto/) | Posit Connect | Install Quarto and TinyTeX on a minimal product image |
| [common/R](./common/R/) | Any | Install specific versions of R on a minimal product image<br/>Install a list of R packages in each R version |
| [common/system-dependencies](./common/system-dependencies/) | Any | Install system dependencies required for additional libraries |
| [vs-code-extensions](./vs-code-extensions/) | Posit Workbench (Standard) | Pre-install a list of VS Code extensions |

To configure a Python package index, use product admin settings rather than baking a `pip.conf` into the image: [Workbench](https://docs.posit.co/ide/server-pro/admin/python/package_installation.html#setting-a-python-package-index-for-sessions) · [Connect](https://docs.posit.co/connect/admin/python/package-management/#python-package-repositories)
Loading
Loading