Description
While attempting to use the Pre-Defined Annotation Keys to track container images back to the corresponding source code, we (re)discovered that org.opencontainers.image.source
(URL to get source code for building the image) is insufficient to determine the source code associated with the image when building from a monorepo. (See #886 for an earlier, less action-oriented version of this issue.)
The particular flavor of this issue is that org.opencontainers.image.source
is likely to be something like https://github.com/opencontainers/image-spec.git
, but those URLs don't provide a way to specify a sub-path within a git repository, which may be useful when building multiple images from a single repo. This is a common practice for many projects, including Kubernetes, Tekton, and Knative (three projects I've interacted with the most).
I'd like to propose documenting the following additional Pre-Defined Annotation Key:
org.opencontainers.image.source.subpath
: A relative path within the source repository used as the base directory to build the container (string)
A few questions on definition which we can either ignore, document, or finesse to avoid defining:
- Windows: do windows image builds use windows path conventions?
- Default / empty value: Does this mean
.
, or unknown? If it means "unknown", does that mean tools should generally set.
? If it means.
, how much do all the existing images mess with this?
I'm happy to propose a PR if this would be useful. @imjasonh @sudo-bmitch as the last two to shepherd changes to this file.