posit-dev / posit-dev/images-shared
Support OS-less images in Bakery
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 22
Description
Problem
Bakery requires every image version to have at least one OS entry with non-empty extension and tagDisplayName fields. Both fields enforce regex patterns that require at least one character (^[a-zA-Z0-9_-]+$ and ^[a-zA-Z0-9_.-]+$), making empty strings invalid.
This prevents building images that don't need an OS, such as:
- Init containers based on
scratchthat only copy static files - Utility images with statically-linked Go binaries
- Any image where the final stage is
FROM scratch
Context
The workbench-session-init image was recently refactored to use FROM scratch since it only contains pre-built static binaries from the rsp-session-multi tarball. The builder stage uses Ubuntu to download and extract the tarball, but the final image has no OS. Despite this, Bakery still requires an OS entry (Ubuntu 24.04), resulting in misleading tags like workbench-session-init:2026.01.1-ubuntu-24.04 for an image that contains no Ubuntu.
Relevant code: posit_bakery/config/shared.py lines 14-34 define ExtensionField and TagDisplayNameField with patterns that reject empty strings.
Proposed solution
Allow OS extension and tagDisplayName to be empty strings (or omitted entirely) so that:
- The Containerfile has no OS suffix (e.g., just
Containerfile.jinja2) - Tags omit the OS component (e.g.,
workbench-session-init:2026.01.1with no-ubuntu-24.04suffix)
This could be implemented by:
- Making the regex patterns accept empty strings:
^[a-zA-Z0-9_.-]*$ - Or adding a new OS-less image mode that skips OS-related naming entirely
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with posit_bakery/config/shared.py lines 14-34, then inspect the linked PR #41 and the open pull request for the current implementation direction. Verify that OS-less images can use empty or omitted OS fields, produce a Containerfile without an OS suffix, and generate tags without an OS component.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- build-system, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100