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
scratch that 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.1 with no -ubuntu-24.04 suffix)
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
Problem
Bakery requires every image version to have at least one OS entry with non-empty
extensionandtagDisplayNamefields. 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:
scratchthat only copy static filesFROM scratchContext
The
workbench-session-initimage was recently refactored to useFROM scratchsince it only contains pre-built static binaries from thersp-session-multitarball. 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 likeworkbench-session-init:2026.01.1-ubuntu-24.04for an image that contains no Ubuntu.Relevant code:
posit_bakery/config/shared.pylines 14-34 defineExtensionFieldandTagDisplayNameFieldwith patterns that reject empty strings.Proposed solution
Allow OS
extensionandtagDisplayNameto be empty strings (or omitted entirely) so that:Containerfile.jinja2)workbench-session-init:2026.01.1with no-ubuntu-24.04suffix)This could be implemented by:
^[a-zA-Z0-9_.-]*$References